MicrOS
strcspn.c File Reference
#include "../string.h"

Functions

size_t strcspn (const char *str1, const char *str2)
 Get span until character in string. More...
 

Function Documentation

◆ strcspn()

size_t strcspn ( const char *  str1,
const char *  str2 
)

Get span until character in string.

Scans str1 for the first occurrence of any of the characters that are part of str2, returning the number of characters of str1 read before this first occurrence.

Parameters
str1C string to be scanned.
str2C string containing the characters to match.
Returns
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.