Re: Parsing NSString
Re: Parsing NSString
- Subject: Re: Parsing NSString
- From: "Seth A. Roby" <email@hidden>
- Date: Mon, 24 Jan 2005 22:02:12 -0800
On Jan 24, 2005, at 6:17 PM, Henry Maddocks wrote:
<x-tad-bigger>- (</x-tad-bigger><x-tad-bigger>NSArray</x-tad-bigger><x-tad-bigger> *)componentsSeparatedByString:(NSString *)</x-tad-bigger>separator
But...
NSString* argList = @"command arg1 arg2 \t arg3 \t\targ4";
[argList componentsSeparatedByString:@" "];
// yields: @"arg1", @"arg2", @"\t", @"arg3", @"\t\targ4"
[argList componentsSeparatedByString:@"\t"];
// yields: @"arg1 arg2 ", @" arg3 ", @"", @"arg4"
There's no (easy) way to do a componentsSeperatedByAnyOfTheseStrings:, unfortunately.
Seth A. Roby The Amazing Llama < mail or AIM me at tallama at mac dot com>
"Life is like an exploded clown. It's really funny until you figure out what just happened."
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden