Guardian C Library Calls Reference Manual
stcis (supplementary)
3-180 128833—Guardian TNS C Library Calls Reference Manual
Reference to Library Calls
stcis (supplementary)
The stcis function scans one string until it finds a character not specified in another
string. For an equivalent ISO C Standard function, refer to “strspn” on page 3-208.
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 of *str1_ptr is not in *str2_ptr, then stcis returns zero.
Example
This example scans string s and finds seven characters before it encounters a character
that is not also in string i:
#include <stringh>
#include <stdioh>
int main(void)
{
size_t length;
char *s;
char *i;
s = "+147692 231 37356841";
i = "1234567890-+"; /* list of included characters */
length = stcis(s,i);
printf("%d\n",length); /* prints "7" */
}
#include <stringh>
size-t stcis(char *str1_ptr, char *str2_ptr);