Created
August 9, 2011 06:56
-
-
Save pratikshabhisikar/1133530 to your computer and use it in GitHub Desktop.
NSScanner
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSString *date = nil; | |
NSScanner *scanner = [NSScanner scannerWithString:@"/Date(1312603200000-0400)/"]; | |
while ([scanner isAtEnd] == NO) { | |
[scanner scanUpToString:@"(" intoString:NULL]; | |
[scanner setScanLocation:[scanner scanLocation] + 1]; | |
[scanner scanUpToString:@")" intoString:&date]; | |
break; | |
} | |
NSLog(@"Date is: %@", date); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment