0
在Swift 3.0中循環一個子字符串的最佳方法是什麼?在Swift 3.0中循環遍歷子字符串
var start = s.startIndex
var end = s.index(s.endIndex, offsetBy: -10)
for i in start...end {
}
以下代碼將引發錯誤:Type ClosedRange<String.Index> (aka ‘ClosedRange<String.CharacterView.Index>’) does not conform to Sequence protocol
。