Swift4:substring(from:)'已弃用

时间:2017-09-18 10:33:09

标签: ios swift string swift4 xcode9

我最近将我的Swift3项目转换为新的Swift4,我收到了一些警告:

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

这是我的代码:

let index = row.index(row.startIndex, offsetBy: 1)
let substring = row.substring(from : index)

有人能给我一个干净的解决方案吗?

谢谢!

0 个答案:

没有答案