cpp_<string>函数整理

getline(cin,str);    //整行字符串读入

str.size();
str.empty();
str.clear();

·查找

t.find(str[i])    //string t中查找str[i],并返回位置
                    //找不到则返回npos
//eg
if(t.find(str[i])==str.npos){ }    //如果t中没有找到str[i]

 

posted @ 2019-02-14 11:07  Complex_Analysis  阅读(310)  评论(0编辑  收藏  举报