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);
string1
string2
Terminating null characters are not considered in the search.
wcscspn is a wide-character version of strcspn.
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
.
tchar.h routine |
_UNICODE not defined |
_UNICODE defined |
---|---|---|
_tcscspn | strcspn | wcscspn |
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 |