• 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: multiple componentsSeparatedByString
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: multiple componentsSeparatedByString


  • Subject: Re: multiple componentsSeparatedByString
  • From: Koen van der Drift <email@hidden>
  • Date: Sun, 24 Nov 2002 21:03:04 -0500

>Unfortunately, this doesn't work. Starting with the string
>"QWERTYASDFGZXCVBNM" I get three single charcters as result: "A" "C" and "B",
>instead of "QWERTYA", "SDFGZXC", "VB" and "NM".


OK, I solved it - I think. I changed the code to:

while (! [scanner isAtEnd])
{
if ([scanner scanUpToCharactersFromSet:stopSet intoString:&result])
{
[scanner scanCharactersFromSet:stopSet intoString:&extra];

if (! [scanner isAtEnd] )
result = [result stringByAppendingString:extra];

[anArray addObject:result];
}
}


This seems to work. The 'extra' string is needed to add the character from
stopSet to 'result'.

- Koen.
_______________________________________________
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: multiple componentsSeparatedByString
      • From: Jonathan Jackel <email@hidden>
  • Prev by Date: Re: Quick Q
  • Next by Date: Re: Anti-alias an NSIamgeView
  • Previous by thread: Re: multiple componentsSeparatedByString
  • Next by thread: Re: multiple componentsSeparatedByString
  • Index(es):
    • Date
    • Thread