主帖
1 条回复
swift中substringWithRange有没有语法糖?
这样写起来好不优雅😅
let startIndex = string.index(string.startIndex, offsetBy: range.location)
let endIndex = string.index(startIndex, offsetBy: range.length)
let word = String(string[startIndex..<endIndex])