Everything

strcspn


Checks a specified string from the beginning and counts the number of consecutive characters at the beginning that are not included in another string specified.

[Format]

#include <string.h>

size_t strcspn (const char *s1, const char *s2);

[Parameters]

s1 Pointer to the string to be checked

s2 Pointer to the string used to check s1

[Return values]

Number of characters at the beginning of the s1 string that are not included in the s2 string

[Remarks]

The strcspn function checks from the beginning of the string specified by s1, counts the number of consecutive characters that are not included in another string specified by s2, and returns that length.

The null character at the end of the s2 string is not taken as a part of the s2 string.