HardCode HardCode - 1 year ago 119
Objective-C Question

How to make first letter uppercase?

I'm developing an iPhone app. In a label, i want to show an user's first letter of the name uppercase. How do I do that?

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download