Convert Character to Integer in Swift -
i creating iphone app , need convert single digit number integer.
my code has variable called char has type character, need able math it, therefore think need convert string, cannot find way that.
with character
can create string
. , string
can create int
.
let char: character = "1" if let number = int(string(char)) { // use number }
Comments
Post a Comment