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

html - Styling progress bar with inline style -

java - Oracle Sql developer error: could not install some modules -

How to use autoclose brackets in Jupyter notebook? -