I have a string: "apple"
. How can I convert only the first character to uppercase and get a new string in the form of "Apple"
?
I can also have a string with multibyte characters.
What if the first character of the string is a multibyte character ?
string str = "something";
str[0] = toupper(str[0]);
That's all you need to do. It also works for C strings.