Convert a String In C++ To Upper Case

后端 未结 30 1546
一个人的身影
一个人的身影 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:46

    not sure there is a built in function. Try this:

    Include either the ctype.h OR cctype libraries, as well as the stdlib.h as part of the preprocessor directives.

    string StringToUpper(string strToConvert)
    {//change each element of the string to upper case
       for(unsigned int i=0;i

提交回复
热议问题