📜  swift 将字符串转换为 int - Swift 代码示例

📅  最后修改于: 2022-03-11 15:00:59.254000             🧑  作者: Mango

代码示例3
let myString1 = "10"
let myInt1 = Int(myString1) ?? 0
// you need to provide the optional in case the string can't be converted