摘要: Swift 3的String有三个方法用于做字符串截取: 用于做示范的示例: str.substring(to: String.Index) 这个方法会从字符串的开始截取到to参数指定的索引。 substring(from: String.Index) 这个方法会从from参数指定的索引截取到字符串 阅读全文