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

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -