In my iPhone app, I want to capitalize the first character in my UITextField's text.
How can it be done?
Simple:
NSString *text = [textField text];
NSString *capitalized = [[[text substringToIndex:1] uppercaseString] stringByAppendingString:[text substringFromIndex:1]];
NSLog(@"%@ uppercased is %@", text, capitalized);
In Interface Builder (or IB integrated into Xcode 4), if you click on UITextField you can set the text and keyboard behaviour.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With