【お知らせ】この部分は英語原文のみでの提供となります。何卒ご了承ください。
2.2.3.15.7 string::FindOneOf
Contents
Description
Search this string for the first character that matches any character contained in lpszCharSet.
Syntax
int FindOneOf( LPCSTR lpszCharSet )
Parameters
- lpszCharSet
- [input] string containing characters for matching.
Return
The zero-based index of the first character in this string that is also in lpszCharSet. -1 if there is no match.
Examples
EX1
void string_FindOneOf_ex1() { string str("abcdef"); int nRet = str.FindOneOf("cd"); //return the first matching index out_int("", nRet); // 2 nRet = str.FindOneOf("xd"); out_int("", nRet); // 3 nRet = str.FindOneOf("gh"); out_int("", nRet); // -1 }
Remark
See Also
Header to Include
origin.h