swift string to int code example
Example 1: convert string to int swift
let myString1 = "10"
let myInt1 = Int(myString1) ?? 0
// you need to provide the optional in case the string can't be converted
Example 2: Flutter turn string to int
// String -> int
main () {
var one = int.parse('1');
print(one == 1); // prints true
}