| Functions | |||||||||||||||||||||||||||||||||||||||||
| Character manipulation | |||||||||||||||||||||||||||||||||||||||||
| Conversions to and from numeric formats | |||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||
| String manipulation | |||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||
| String examination | |||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||
| Memory manipulation | |||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||
| Miscellaneous | |||||||||||||||||||||||||||||||||||||||||
(C11)(C11) | |||||||||||||||||||||||||||||||||||||||||
Defined in header <string.h> | ||
size_t strcspn(constchar*dest,constchar*src); | ||
Returns the length of the maximum initial segment of the null-terminated byte string pointed to bydest, that consists of only the charactersnot found in the null-terminated byte string pointed to bysrc.
The behavior is undefined if eitherdest orsrc is not a pointer to a null-terminated byte string.
Contents |
| dest | - | pointer to the null-terminated byte string to be analyzed |
| src | - | pointer to the null-terminated byte string that contains the characters to search for |
The length of the maximum initial segment that contains only characters not found in the null-terminated byte string pointed to bysrc
The function name stands for "complementary span" because the function searches for characters not found insrc, that is the complement ofsrc.
Output:
'abcde312$#@' contains invalid chars starting at position 8
| returns the length of the maximum initial segment that consists of only the characters found in another byte string (function)[edit] | |
(C95) | returns the length of the maximum initial segment that consists of only the wide charsnot found in another wide string (function)[edit] |
| finds the first location of any character in one string, in another string (function)[edit] | |
C++ documentation forstrcspn | |