INtime SDK Help
strcspn, wcscspn

Returns the index of the first occurrence in a string, of a character that belongs to a set of characters.

#include <string.h>

size_t strcspn (const char *string1, const char *string2);

#include <wchar.h>

size_t wcscspn(const wchar_t *string1, const wchar_t *string2);

Parameters

string1
Source string; must contain a null character marking the end of the string.
string2
Character set to search for; must contain a null character marking the end of the string.

Remarks

Terminating null characters are not considered in the search.

wcscspn is a wide-character version of strcspn.

Return Values

The index of the first character in string1 belonging to the set of characters specified by string2. This value is equivalent to the length of the initial substring of string1 consisting entirely of characters not in string2.

0 if string1 begins with a character from string2.

No return value is reserved to indicate an error. Therefore if no characters from string2 are found, the return value will be the length of string1.

Generic Text Routines

tchar.h routine _UNICODE not defined _UNICODE defined
_tcscspn strcspn wcscspn

Requirements

Versions Defined in Include Link to
INtime 3.0
INtime 6.0 (for wide-character and generic text versions)
intime/rt/include/string.h
intime/rt/include/wchar.h
intime/rt/include/tchar.h
string.h
wchar.h
tchar.h
clib.lib
See Also