Re: Parsing NSString
Re: Parsing NSString
- Subject: Re: Parsing NSString
- From: Henry Maddocks <email@hidden>
- Date: Tue, 25 Jan 2005 15:17:48 +1300
componentsSeparatedByString:
<x-tad-bigger>- (</x-tad-bigger><x-tad-bigger>NSArray</x-tad-bigger><x-tad-bigger> *)componentsSeparatedByString:(NSString *)</x-tad-bigger>separator
Returns an NSArray containing substrings from the receiver that have been divided by separator. The substrings in the array appear in the order they did in the receiver. If the string begins or ends with the separator, the first or last substring, respectively, is empty. For example, this code excerpt:
<x-tad-bigger>NSString *list = @"wrenches, hammers, saws";
NSArray *listItems = [list componentsSeparatedByString:@", "];
</x-tad-bigger>
See Also: <x-tad-bigger>– componentsJoinedByString:</x-tad-bigger> (NSArray), <x-tad-bigger>– pathComponents
</x-tad-bigger>
On 25/01/2005, at 3:12 PM, Michael A. Crawford wrote:
Does anyone know of a quick & easy way to parse an NSString containing text seperated by white-space (i.e. command-line args) into an NSArray?
-Michael
----------------------
There are two ways of constructing a software design. One way is to make it so simple that there are obviously no deficiencies.
And the other way is to make it so complicated that there are no obvious deficiencies.
-- C.A.R. Hoare
_______________________________________________
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
_______________________________________________
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