Re: NSScanner bug?
Re: NSScanner bug?
- Subject: Re: NSScanner bug?
- From: David P Henderson <email@hidden>
- Date: Tue, 22 Oct 2002 17:56:04 -0400
On Tuesday, Oct 22, 2002, at 08:56 US/Eastern, Mark's Studio wrote:
I am trying to scan a text file, and i use this
if([theScanner scanUpToString:@"ABC" intoString:NULL])
if the textfile contains "ABC" at the beginning the scanner will not
find it, and it will not find the next "ABC".
BUG???
No, it is working as advertised. Since the test string starts with the
stop case no characters are scanned. The method scans up to but does
not include the stop string nor does it move the scanner past the stop
string so subsequent scans never move beyond the start of the test
string. To get the desired result you must follow the scanUpToString:
message with a message which eats the stop string causing the scanner
to move forward.
Dave
--
Chaos Assembly Werks
"Suburbia is where the developer bulldozes out the trees, then names
the streets after them."
- Bill Vaughn
_______________________________________________
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.