Created
January 30, 2018 03:30
-
-
Save el-hoshino/3f4f166f5b0e2df399cad0d7786b37c8 to your computer and use it in GitHub Desktop.
Using Scanner to scan String to Int in Swift (Objective-C way)
This file contains hidden or 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 string = "123" | |
let scanner = Scanner(string: string) | |
var int = NSNotFound | |
scanner.scanInt(&int) | |
print(int) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment