NSScanner problem...
NSScanner problem...
- Subject: NSScanner problem...
- From: Onar Vikingstad <email@hidden>
- Date: Sun, 21 Apr 2002 21:39:38 +0200
I'm having a wierd problem I can't figure out with NSScanner. When I use
setCharactersToBeSkipped in the second last line (as shown in my code),
only the first " gets skipped, not the second one at the end of the
string. [thisLine self] originally is:
Name "hey hey"
but the actual value of name string which is specified at intoString
will be:
hey hey"
This is the code I'm using now:
NSScanner *scanString = [[NSScanner alloc]
initWithString:[thisLine self]];
NSString *name;
[scanString scanString:@"Name" intoString:nil];
[scanString setScanLocation: [scanString scanLocation]+1 ];
[scanString setCharactersToBeSkipped:[NSCharacterSet
characterSetWithCharactersInString:@"\"'"]];
[scanString scanUpToString:@"\n" intoString:&name];
Is this the way it's supposed to work? How can I get it to skip also the
last " ?
_______________________________________________
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.