Created
September 16, 2014 03:28
-
-
Save masters3d/32400bf9e2dd17830690 to your computer and use it in GitHub Desktop.
swift scanner
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
let altStringToSearch:NSString = "I want to make a cake and then prepare coffee" | |
let altSearchTerm:NSString = "cake" | |
let altScanner = NSScanner(string: altStringToSearch) | |
var altResult:NSString? | |
altScanner.scanUpToString(altSearchTerm, intoString:&altResult) | |
println(altResult!) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment