我只想移除字符串的一部分。
if let dotRange = detailArticleContent?.range(of: "<iframe") {
detailArticleContent.removeSubrange( dotRange.lowerBound... < detailArticleContent.endIndex )
//In this line i got err : '...' is not a postfix unary operator
}发布于 2017-08-10 11:44:18
使用... (近距)或..< (前半近距),没有比... <更好的了
发布于 2018-07-04 08:59:04
在我的例子中,我给出了0..<和0..<之间的空间
正确的一个是:
0..<dictionary.count
//Wrong
let dictionary = dic["predictions"] as! [String:Any]
print(dictionary)
for index in 0..< dictionary.count {
print(<#T##items: Any...##Any#>)
}
//Correct
let dictionary = dic["predictions"] as! [String:Any]
print(dictionary)
for index in 0..<dictionary.count {
print(<#T##items: Any...##Any#>)
}https://stackoverflow.com/questions/45612782
复制相似问题