// 判断输入的字符串是否为数字,不含其它字符
func isPurnInt(string: String) -> Bool {
let scan: Scanner = Scanner(string: string)
var val:Int = 0
return scan.scanInt(&val) && scan.isAtEnd
}
2023-07-18 08:24:46
// 判断输入的字符串是否为数字,不含其它字符
func isPurnInt(string: String) -> Bool {
let scan: Scanner = Scanner(string: string)
var val:Int = 0
return scan.scanInt(&val) && scan.isAtEnd
}