1.截取某字符串的前10个字符串:
let sub1 = str.prefix(10)
截取某字符串的后10个字符串
let str1 = str.suffix(10)
也可以换种写法
let index2 = str.index(str.endIndex, offsetBy: -10)
let sub4 = str[index2..<str.endIndex]
截取某字符串的第3个字符到第6个字符范围的字符串
let index3 = str.index(str.startIndex, offsetBy: 3)
let index4 = str.index(str.startIndex, offsetBy: 6)
let sub4 = str[index3..<index4]
2. JSONDecoder实现转Model:
https://developer.apple.com/documentation/foundation/jsondecoder
https://www.jianshu.com/p/ca1b9094d0e9
3.Swift常用基本第三方: