Re: Changing Case
Re: Changing Case
- Subject: Re: Changing Case
- From: Stephane Sudre <email@hidden>
- Date: Thu, 18 Mar 2004 18:36:10 +0100
On Thursday, March 18, 2004, at 03:40 PM, Alastair Houghton wrote:
On 18 Mar 2004, at 13:48, Mathew Peterson wrote:
Is there any neat Cocoa way of changing the case of a single character
or string? I am just looking around in the NSText world for the first
time and I am probably missing something rather simple.
What's wrong with doing e.g.
NSMutableString *myString = [NSMutableString
stringWithUTF8String:"hello"];
NSRange rangeOfCharacter = NSMakeRange(0,1);
[myString
replaceCharactersInRange:rangeOfCharacter
withString:[[myString substringWithRange:rangeOfCharacter]
uppercaseString]];
I suppose you might argue that this kind of thing is overkill
It's potentially a monster kill.
NSMutableString *myString = [NSMutableString
stringWithUTF8String:"hello"];
myString=[myString capitalizedString];
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.