HardCode HardCode - 2 months ago 8x
Objective-C Question

How to make First letter upper case on objective-c?

I'm developing an iPhone app. I want to show the user's first letter of the name upper case and the rest lower case. How do I do that on objective-C?


If there is only one word-NSString, then use the method


NSString *capitalizedString = [myStr capitalizedString]; // capitalizes every word

Otherwise, for multi word strings, you have to extract first character and make only that character upper case.