std::string转化大小写(C++)

#include <string>

#include <algorithm>



void test()

{

  std::string strA="QQQQWWWqqqqqqwwwwwww;



  //std::string的大小写转换

  transform(strA.begin(), strA.end(), strA.begin(), ::toupper);

  transform(strA.begin(), strA.end(), strA.begin(), ::tolower);

}

 

你可能感兴趣的:(String)