strspn() — Search String

Format

#include <string.h>

size_t strspn(const char *string1, const char *string2);

General Description

The strspn() function calculates the length of the maximum initial portion of the string pointed to by string1 that consists entirely of the characters contained in the string pointed to by string2.

Returned Value

The strspn() function returns the length of the substring found.

Related Information