Last active
March 1, 2018 10:20
-
-
Save dev4dev/5128f227e11fa440955b3023a169e30a to your computer and use it in GitHub Desktop.
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 a = "13" | |
let b = "13a" | |
if let a = Int(a), let b = Int(b) { | |
let result = a + b | |
print(result) // will print only if b is correct number | |
} else { | |
print("fuck you spilberg") | |
} | |
let result = (Int(a) ?? 0) + (Int(b) ?? 0) | |
print(result) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment