string 如何转成小写

2022-02-10 21:48:25 浏览数 (1)

代码语言:javascript复制
#include <algorithm>
#include <cctype>
#include <string>

std::string data = "Abc";
std::transform(data.begin(), data.end(), data.begin(),
    [](unsigned char c){ return std::tolower(c); });

0 人点赞