随笔分类 -  字符串处理

摘要:substr: basic_string substr( size_type index, size_type num = npos ); substr()返回本字符串的一个子串,从index开始,长num个字符。如果没有指定,将是默认值 string::npos。这样,substr()函数... 阅读全文
posted @ 2015-08-20 16:40 _SunDaSheng 阅读(146) 评论(0) 推荐(0)
摘要:C/C++函数,比较两个字符串设这两个字符串为str1,str2,若str1==str2,则返回零;若str1>str2,则返回正数;若str1#include#include#includeusing namespace std;mapM;int main(){ M["zero"]=... 阅读全文
posted @ 2015-08-09 09:48 _SunDaSheng 阅读(133) 评论(0) 推荐(0)