welibc
A clear, secure, and well documented standard C library
Functions
strcspn.c File Reference

Defines the strcspn function. More...

#include <string.h>
Include dependency graph for strcspn.c:

Go to the source code of this file.

Functions

size_t strcspn (const char *s1, const char *s2)
 Find the length of the span of complementary characters to s2 in s1. More...
 

Detailed Description

Defines the strcspn function.

Definition in file strcspn.c.

Function Documentation

◆ strcspn()

size_t strcspn ( const char *  s1,
const char *  s2 
)

Find the length of the span of complementary characters to s2 in s1.

Parameters
*s1String being searched
*s2String of characters not counted in the span being found

The strcspn function computes the length of the maximum initial segment of the string pointed to by s1 which consists entirely of characters not from the string pointed to by s2.

Returns
The length of the segment

Definition at line 52 of file strcspn.c.

References strchr(), and strlen().

Referenced by strpbrk(), and strtok().

Here is the call graph for this function:
Here is the caller graph for this function: