大小写转换:
利用STL的algorithm库
#include<algorithm>
string a = "ABC";
string b = "abc";
transform(a.begin(), a.end(), a.begin(), ::tolower); //转换为小写
transform(a.begin(), a.end(), a.begin(), ::toupper); //转换为大写
大小写转换:
利用STL的algorithm库
#include<algorithm>
string a = "ABC";
string b = "abc";
transform(a.begin(), a.end(), a.begin(), ::tolower); //转换为小写
transform(a.begin(), a.end(), a.begin(), ::toupper); //转换为大写