Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SWIFT

swift convert string to int

let myString1 = "10"
let myInt1 = Int(myString1) ?? 0
// you need to provide the optional in case the string can't be converted
 
PREVIOUS NEXT
Tagged: #swift #convert #string #int
ADD COMMENT
Topic
Name
5+6 =