Guardian C Library Calls Reference Manual
Reference to Library Calls
Guardian TNS C Library Calls Reference Manual—128833 3-181
stcisn (supplementary)
stcisn (supplementary)
The stcisn function scans one string until it finds a character that is specified in another
string. For an equivalent ISO C Standard function, refer to “strcspn” on page 3-197.
str1_ptr
points to the string to scan.
str2_ptr
points to the string to scan for. This string can contain any legal character.
Return Value
is the number of characters scanned, except for the character that ended the scan. If
the first character in *str1_ptr is also in *str2_ptr, then stcisn returns zero.
Example
This example scans string s and finds 11 characters before it encounters a character that
is also in string b:
#include <stringh>
#include <stdioh>
int main(void)
{
size_t length;
char *s;
char *b;
s = "Tandem (adv.): one behind another.";
b = ":!;."; /* list of break characters */
length = stcisn(s, b);
printf("%d\n",length); /* prints "11" */
}
#include <stringh>
size-t stcisn(char *str1_ptr, char *str2_ptr);