swift2 - Get integer value from string in swift -
so can this:
var stringnumb: nsstring = "1357" var somenumb: cint = stringnumb.intvalue
but can't find way w/ string
. i'd like:
var stringnumb: string = "1357" var somenumb: int = int(stringnumb)
this doesn't work either:
var somenumbalt: int = mystring.integervalue
swift 2.0 can initialize integer using constructor
var stringnumber = "1234" var numberfromstring = int(stringnumber)
Comments
Post a Comment