Convert a String In C++ To Upper Case

后端 未结 30 1862
一个人的身影
一个人的身影 2020-11-22 05:25

How could one convert a string to upper case. The examples I have found from googling only have to deal with chars.

30条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-22 05:50

    You can simply use this in C++17

    for(auto i : str) putchar(toupper(i));
    

提交回复
热议问题