如题所述
第1个回答 2016-07-25
比如查找 字符串 "abdbmdef" 里是否包含'm'
string str = "abdmdef"
int pos = str.find("m")
pos 会返回"m"的所在位置 , 如果没有找到就会返回-1本回答被网友采纳
string str = "abdmdef"
int pos = str.find("m")
pos 会返回"m"的所在位置 , 如果没有找到就会返回-1本回答被网友采纳
第2个回答 2016-07-25
string txt="asdjsfk/aaaaaaaaa";
if(txt.Contains("/"))//检验“/”
{
txt.Replace('/','x/');//替换“/”为“x/”
}本回答被提问者采纳
if(txt.Contains("/"))//检验“/”
{
txt.Replace('/','x/');//替换“/”为“x/”
}本回答被提问者采纳