'substring(from:)' is deprecated: Please use String slicing subscript with a 'partial range from' operator.

let newStr = String(str[..<index]) // = str.substring(to: index) In Swift 3
let newStr = String(str[index...]) // = str.substring(from: index) In Swif 3
let newStr = String(str[range]) // = str.substring(with: range) In Swift 3
posted @ 2017-10-12 13:59  罗小浮  阅读(4300)  评论(0编辑  收藏  举报