Convert a String In C++ To Upper or Lower Case

来源:互联网 发布:淘宝买眼镜靠谱吗 编辑:程序博客网 时间:2024/05/17 03:54
#include <algorithm>#include <string>std::string str = "Hello World";std::transform(str.begin(), str.end(),str.begin(), ::toupper);
#include <algorithm>#include <string> std::string data = "Abc"; std::transform(data.begin(), data.end(), data.begin(), ::tolower);