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
+5.4k WARNING: UNPROTECTED PRIVATE KEY FILE! error message
+9.3k JavaScript/JQuery : Detect or intercept enter key pressed example
+11.4k Golang : zlib compress file example
+3.1k Detect if Google Analytics and Developer Media are loaded properly or not
+22k Find and replace a character in a string in Go
+7.4k Golang : Count leading or ending zeros(any item of interest) example
+9.9k Golang : Delay or limit HTTP requests example
+9.5k Golang : Get local time and equivalent time in different time zone
+17k Golang : Find IP address from string
+11.9k Golang : Increment string example
+8.1k Golang : Create and shuffle deck of cards example
+22.3k Golang : Check if element exist in map