The wcsspn() is a built-in function in C/C++ which returns the length of maximum initial segment of the wide string that consists of characters present in another wide string. It is defined within the cwchar header file of C++.
Parameters:The function accepts two mandatory parameters as described below.
- des: specifies to a null terminated wide string to be searched.
- src: specifies to a null terminated wide string containing the characters to search for.
Return Value: The function returns the length of the maximum initial segment of des that contains only the wide characters from wide string pointed to by src.
Below programs illustrate the above function.
6010IshwarGupta contains 4 initial numbers
GeeksforGeeks doesn't start with numbers