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
+4.5k Golang : Valued expressions and functions example
+7.8k Golang : Test if an input is an Armstrong number example
+13.3k Golang : How to calculate the distance between two coordinates using Haversine formula
+9.5k Golang : Terminate-stay-resident or daemonize your program?
+11.3k Golang : Fix go.exe is not compatible with the version of Windows you're running
+35.3k Golang : Upload and download file to/from AWS S3
+9.6k Golang : Detect Pascal, Kebab, Screaming Snake and Camel cases
+12.7k Golang : Exit, terminating or aborting a program
+24.1k Golang : Call function from another package
+8.2k Golang : HTTP Server Example
+5.5k Python : Delay with time.sleep() function example
+34.9k Golang : How to stream file to client(browser) or write to http.ResponseWriter?