The search includes the terminating null-characters, so the function will return the length of str1 if none of the characters of str2 are found in str1.
Parameters
- str1
- C string to be scanned.
- str2
- C string containing the characters to match.
Return value
The length of the initial part of str1 not containing any of the characters that are part of str2.This is the length of str1 if none of the characters in str2 are found in str1.
Example
| 1 2 3 4 5 6 7 8 9 10 11 12 13 |
|
Output:
The first number in str is at position 5 |
See also
| strspn | Get span of character set in string (function) |
| strstr | Locate substring (function) |
| strncmp | Compare characters of two strings (function) |
