创建字符串偏移量时,遇到罕见的崩溃:
specialized specialized _BidirectionalIndexable.index(A.Index, offsetBy : A.IndexDistance) -> A.Index**
这是我的代码:
let cloud_data ="2332333223325#"
let data_substring = "test-" + cloud_data.substring(from:cloud_data.index(cloud_data.endIndex, offsetBy: -4))
这是上面的代码,用于获取子字符串。行号73是上面的行号。附上日志截图: