Standard C Functions


strcspn


Syntax

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

Arguments

string1      character string to be searched 
string2 holds the characters that are all to be compared to each character in string1 sequentially until one of the characters in string2 is found in string1

Return Value

The length of the maximum initial segment of string1 that consists entirely of characters that do 
not exist in string2 

Description

It computes and returns the length of the maximum initial segment of string1 that consists entirely of characters not found in string2.