C++ strspn() is an inbuilt string handling function that works with two parameters and returns the length of the initial substring of the string which is pointed by the first parameter(string1) which only consists of the characters that are present in the string which is pointed by the second parameter(string2). It is defined as a string.h header file.

C++ strspn()

The strspn() method in C++ takes two string destination and source and gives the length of the maximum initial segment of the string destination that consists of characters that are present in the string source.

Syntax

size_t strspn( const char* destination_var, const char* source_var)

#c++ #c++ strchr()

C++ strchr() Function Example | std::strchr In C++
1.60 GEEK