neu*_*cer 3 c++ string
我想检查我的字符串是否有两个连续的空格.找出最简单的方法是什么?
unw*_*ind 6
使用find()方法std::string.std::string::npos如果找不到值,它将返回特殊常量,因此很容易检查:
find()
std::string
std::string::npos
if (myString.find(" ") != std::string::npos) { cerr << "double spaces found!"; }
归档时间:
15 年,8 月 前
查看次数:
1679 次
最近记录: