Re: HELP!! [self needsHelpWith:strings];
Re: HELP!! [self needsHelpWith:strings];
- Subject: Re: HELP!! [self needsHelpWith:strings];
- From: email@hidden
- Date: Tue, 21 May 2002 09:08:44 -0700
Christopher OBrien wrote:
|I am working on a major major project and I need to remove certain
|characters from an NSString. Is it also possible to remove white space
|from an NSString?
Have you read the NSString and NSMutableString documentation? The problem amounts to
for each character in string
if the character is one of the "certain characters",
delete it
The basic methods would be characterAtIndex: and deleteCharactersInRange:. You could get fancier with rangeOfCharactersFromSet:.
As to white space, there's nothing special about it; white space is just "certain characters", too. The question is simply what characters you want to consider "white space". Once you've decided that, you delete them like any other set of characters.
Glen Fisher
_______________________________________________
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.