RosettaCodeData/Task/Increment-a-numerical-string/Swift/increment-a-numerical-string-1.swift

5 lines
57 B
Swift
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
let s = "1234"
if let x = Int(s) {
print("\(x + 1)")
}