Convert first letter in string to uppercase
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. I cannot use str[0] because, I can have string which has multibyte characters I don't know of any CRT implementation that supports non-ASCII character classification and conversion. If you want to support Unicode then everything is much more