Jump to content

how to capitalize first letter of NSString


4 posts in this topic

Recommended Posts







Returns a capitalized representation of the receiver.


- (NSString *)capitalizedString


Return Value

A string with the first character from each word in the receiver changed to its corresponding uppercase value, and all remaining characters set to their corresponding lowercase values.



A “word” here is any sequence of characters delimited by spaces, tabs, or line terminators (listed under getLineStart:end:contentsEnd:forRange:). Other common word delimiters such as hyphens and other punctuation aren’t considered, so this method may not generally produce the desired results for multiword strings.


Case transformations aren’t guaranteed to be symmetrical or to produce strings of the same lengths as the originals. See lowercaseString for an example.



Available in Mac OS X v10.0 and later.

See Also

– lowercaseString

– uppercaseString

Declared In


Link to comment
Share on other sites


  • Create New...