strspn function(Search String for Initial Span of Characters in Set) in C Language – example and detail

In the C Programming Language, the strspn feature searches within the string pointed to by using s1 for the string pointed to through s2. It returns the index of the first persona that is not in the set.

Syntax

The syntax for the strspn feature in the C Language is:

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

Parameters or Arguments

s1 A string to search within. s2 The string that you want to find.

Returns

The strspn function returns the index of the first personality that is not in the set.

Required Header

In the C Language, the required header for the strspn feature is:

#include <string.h>

Applies To

In the C Language, the strspn feature can be used in the following versions:

ANSI/ISO 9899-1990

See Also

Other C features that are noteworthy when dealing with the strspn function:

strcspn function <string.h>