用c++ sttring检测名字是否有空格

name.find(' ') == std::string::npos//npos==-1,表示没找到
原文地址:https://www.cnblogs.com/confusion/p/9240707.html