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

Popular posts from this blog

Django REST Framework perform_create: You cannot call `.save()` after accessing `serializer.data` -

Why does Go error when trying to marshal this JSON? -