Jump to content

how to capitalize first letter of NSString


ishaq
 Share

4 posts in this topic

Recommended Posts

http://developer.apple.com/documentation/C...e/NSString.html

 

 

 

capitalizedString

 

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.

 

Discussion

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.

 

Availability

Available in Mac OS X v10.0 and later.

See Also

– lowercaseString

– uppercaseString

Declared In

NSString.h

Link to comment
Share on other sites

 Share

×
×
  • Create New...