STL_string.ZC

1、转成 小写/大写

#include <algorithm>
using namespace std;

// 转成小写
transform(_strAttrNameG.begin(), _strAttrNameG.end(), _strAttrNameG.begin(), tolower);// toupper

2、去除 收尾空格

string& trim(string &s)   
{  
    if (s.empty())   
    {  
        return s;  
    }  
    s.erase(0,s.find_first_not_of(" "));  
    s.erase(s.find_last_not_of(" ") + 1);  
    return s;  
} 

 

3、

4、

5、

 

posted @ 2018-05-24 16:14  CppSkill  阅读(152)  评论(0编辑  收藏  举报