Re: HELP!! [self needsHelpWith:strings];
Re: HELP!! [self needsHelpWith:strings];
- Subject: Re: HELP!! [self needsHelpWith:strings];
- From: Jens Bauer <email@hidden>
- Date: Tue, 21 May 2002 18:17:54 +0200
Hi Christopher,
On Tue, 21 May, 2002, Christopher OBrien <email@hidden> wrote:
>
Hi all. 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? All feedback is welcome and appreciated. Thanks.
Not really a problem. Here's one solution you could use:
NSMutableString *url;
NSString *with;
NSRange range;
str = [NSMutableString stringWithCapacity:256];
[str setString:NSLocalizedStringFromTable(@"Just a strange string",
@"stringfile", "The strange string")];
range = [str rangeOfString:@"Find"];
if(NSNotFound != range.location)
{
if(NSOnState == [enablereplacement state])
{
with = [replacement stringValue];
}
else
{
with = @"";
}
[str replaceCharactersInRange:range withString:with];
}
-Now, this was a bit more than you asked for, but it was copied, pasted
and modified.
Love,
Jens
--
Jens Bauer, Faster Software.
-Let's make the World better, shall we ?
_______________________________________________
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.