strcspn() — Compare Strings

Format

#include <string.h>

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

General Description

The strcspn() function computes the length of the initial portion of the string pointed to by string1 that contains no characters from the string pointed to by string2.

Returned Value

The strcspn() function returns the calculated length of the initial portion found.

Related Information