swift怎么把String?转化成Int

2025-04-04 05:38:24
推荐回答(1个)
回答1:

let value = Int("123455")!
let value3 = Int.init("23456")!

let value2 = Double("123.4")!
print(value,"-----",value2,"--------",value3)
打印

123455 ----- 123.4 -------- 23456