我有
Xcode 7 gm,swift 2.0是什么等效的表达式:
Let myNSString = "full text container" myNSString.substringWithRange(NSRange(location: 0,length: 3))
有了新的字符串类吗?
试试这个:
let myString = "full text container" myString[myString.startIndex..<myString.startIndex.advancedBy(3)]