Standard C Functions


strspn


Syntax

#include <string.h>
size_t strspn(const char *string1, const char *string2);

Arguments

string1      character string to be searched
string2      character string to find

Return Value

The length of the initial segment of string1 that contains string2 in its entirety

Description

It computes the length of the maximum initial segment of string1 that completely holds string2 and then returns the length of the segment.