So I can do this:
var stringNumb: NSString = \"1357\"
var someNumb: CInt = stringNumb.intValue
But I can\'t find the way to do it w/ a
If you are able to use a NSString
only.
It's pretty similar to objective-c. All the data type are there but require the as NSString
addition
var x = "400.0" as NSString
x.floatValue //string to float
x.doubleValue // to double
x.boolValue // to bool
x.integerValue // to integer
x.intValue // to int
Also we have an toInt()
function added See Apple Inc. “The Swift Programming Language.” iBooks. https://itun.es/us/jEUH0.l page 49
x.toInt()