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、

猜你喜欢

转载自www.cnblogs.com/cppskill/p/9083447.html