A friend asked why anyone would want the behavior of capitalizedString. The only thing I could think of was to convert all caps to title case, which seems an odd scenario to provide API support for.
Is there a more common need for this method that I haven't thought of? --Andy Begin forwarded message: > Got bit by this: "and all remaining characters set to their corresponding > lowercase values" - why would anyone want that? > > - (NSString *)capitalizedString > > Description > > Returns a capitalized representation of the receiver. > > > > A “word” is any sequence of characters delimited by spaces, tabs, or line > terminators (listed under getLineStart:end:contentsEnd:forRange:). Some > common word delimiting punctuation isn’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. > > Note > > This method performs the canonical (non-localized) mapping. It is suitable > for programming operations that require stable results not depending on the > user's locale preference. For localized case mapping for strings presented to > users, use the capitalizedStringWithLocale: method. > > Returns > > 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. _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com