swift 4 中的 substring

swift 3

// from
string.substring(from: range.lowerBound)

// to
string.substring(to: range.upperBound)

//with
string.substring(with: range)

swift 4

// from
String(string[range.lowerBound...])
String(string.suffix(from: range.lowerBound))

// to
String(string[..

你可能感兴趣的:(swift 4 中的 substring)