Swift : Convert (cast) Character to Integer?
Problem :
How to convert (cast) character to integer in Swift programming language ?
Solution :
Simple. Just cast the character variable with Int() function. For example :
let intchar = Int(character)
See also : Swift : Convert (cast) Int to String ?
By Adam Ng
IF you gain some knowledge or the information here solved your programming problem. Please consider donating to the less fortunate or some charities that you like. Apart from donation, planting trees, volunteering or reducing your carbon footprint will be great too.
Advertisement
Tutorials
+31.2k Golang : How to check if a date is within certain range?
+28k Golang : How to declare kilobyte, megabyte, gigabyte, terabyte and so on?
+13.4k Golang : package is not in GOROOT during compilation
+5k Golang : Detect variable or constant type
+9.1k Golang : How to tokenize source code with text/scanner package?
+14.8k Golang : Get sub string example
+7.7k Golang : Sort lines of text example
+9.2k Golang : cannot assign type int to value (type uint8) in range error
+11.4k Golang : Exit, terminating or aborting a program
+27.5k Golang : Saving(serializing) and reading file with GOB
+6.7k Golang : Test if an input is an Armstrong number example
+26.4k Golang : Move file to another directory