字符串中的TOUPPER函数

std::string& str_toupper(std::string& s) {
    std::transform(s.begin(), s.end(), s.begin(), 
                   [](unsigned char c){ return ::toupper(c); } // correct
                  );
    return s;
}

 

posted @ 2019-07-02 09:34  日月王  阅读(726)  评论(0编辑  收藏  举报