Re: Re: how does one split a block of newline-separated text into an NSArray of NSStrings?
Re: Re: how does one split a block of newline-separated text into an NSArray of NSStrings?
- Subject: Re: Re: how does one split a block of newline-separated text into an NSArray of NSStrings?
- From: mercer <email@hidden>
- Date: Mon, 30 Oct 2006 10:42:58 -0500
thank you, stephen.
On 10/30/06, Stephen Deken <email@hidden> wrote:
Hello,
> Hi. What is the Cocoa way to take a block of text -- where each line
> of text ends with a newline -- and fill an NSArray with NSStrings?
> Each NSString would contain a single line of text.
Try:
NSArray *arr = [myString componentsSeparatedByString:@"\n"];
Much more available here:
<http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/Reference/NSString.html>
Stephen Deken
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