• 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
Splitting strings....
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Splitting strings....


  • Subject: Splitting strings....
  • From: Jerry LeVan <email@hidden>
  • Date: Fri, 27 Feb 2004 20:18:42 -0500

Hi,

I have suddenly developed a need to be able to split a NSString on a ";"
The rub comes in that the semicolon does not count if it is *in* a quoted string.

Also a string can contain a quote character if it is doubled...

So.
blah blah 'I can''t stand '';'' this ;' foolishness ; any ; more
will split into:

blah blah 'I can''t stand '';'' this ;' foolishness
and
any
and
more

I am not to keen on scanning the string char at a time and keeping track of the
uncovered semicolons....

Any one tackled this problem before? Is there an elegant solution?

--Jerry
_______________________________________________
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.


  • Follow-Ups:
    • Re: Splitting strings....
      • From: Allan Odgaard <email@hidden>
  • Prev by Date: Re: Databasing and Cocoa
  • Next by Date: Basic thread example?
  • Previous by thread: Re: Array Operators & array controllers
  • Next by thread: Re: Splitting strings....
  • Index(es):
    • Date
    • Thread