Swift : Convert (cast) String to Integer



Tags : casting swift int string

Problem :

How to convert (cast) String to Integer value in Swift programming language ?

Solution :

Just cast the String variable with toInt() functon. For example :

 var Numbers = "1234"
 var NumbersFromString = Numbers.toInt()

Reference :

https://developer.apple.com/library/mac/documentation/General/Reference/SwiftStandardLibraryReference/index.html

Affiliate :

Hire Golang Developers


  See also : Swift : Convert (cast) Int to String ?



Tags : casting swift int 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