2016-07-21 5 views
-3

次のコードでは、 "||" "|"を含むテキストでは、それでもそれは存在すると言いますか?これを解決するには?特別なchar pieの文字列の競合のfind_first_of "|"

std::string sInputText = "test||111"; 
std::string delimeter = "||"; 

int pos = 0; 
found = sInputText.find_first_of(delimeter); 
if (found == string::npos) 
{ 

} 
+0

std :: string sInputText = "test | 111"; std :: string delimeter = "||"; int pos = 0; が見つかりました= sInputText.find_first_of(delimeter); if(見つかった==文字列:: npos) { } – Suresh

答えて

0

スペックを読む....

は、引数で指定された文字のいずれかのに一致する最初の文字のための文字列を検索します。

関連する問題