• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: how does one split a block of newline-separated text into an NSArray of NSStrings?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how does one split a block of newline-separated text into an NSArray of NSStrings?


  • Subject: Re: how does one split a block of newline-separated text into an NSArray of NSStrings?
  • From: "Stephen Deken" <email@hidden>
  • Date: Mon, 30 Oct 2006 09:32:51 -0600

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


  • Follow-Ups:
    • Re: how does one split a block of newline-separated text into an NSArray of NSStrings?
      • From: Douglas Davidson <email@hidden>
    • Re: Re: how does one split a block of newline-separated text into an NSArray of NSStrings?
      • From: mercer <email@hidden>
References: 
 >how does one split a block of newline-separated text into an NSArray of NSStrings? (From: mercer <email@hidden>)

  • Prev by Date: how does one split a block of newline-separated text into an NSArray of NSStrings?
  • Next by Date: Re: Re: how does one split a block of newline-separated text into an NSArray of NSStrings?
  • Previous by thread: how does one split a block of newline-separated text into an NSArray of NSStrings?
  • Next by thread: Re: Re: how does one split a block of newline-separated text into an NSArray of NSStrings?
  • Index(es):
    • Date
    • Thread