【お知らせ】この部分は英語原文のみでの提供となります。何卒ご了承ください。
2.1.2.51 strcspn
Contents
Description
Find a substring in a string.
Syntax
size_t strcspn( LPCSTR lpcszString, LPCSTR lpcszCharSet )
Parameters
- lpcszString
- [input] String to search through
- lpcszCharSet
- [input] String containing specified character set
Return
Returns the index of the first occurrence of a character in string that is in strCharSet. All characters before returned index are not in character set.
Examples
EX1
void strcspn_ex1() { char str[] = "xyzababc"; int pos; pos = strcspn( str, "abc" ); printf( "First a, b or c in %s is at character %d\n", str, pos ); }
Remark
See Also
Header to Include
origin.h