如何将字符串转换为大写。我从谷歌搜索中找到的例子只需要处理字符。
#include <algorithm> #include <string> std::string str = "Hello World"; std::transform(str.begin(), str.end(), str.begin(), ::toupper);