我只想删除一部分字符串。
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
}
答案 0 :(得分:5)
使用...
(近距离)或..<
(前一半的近距离),没有类似... <
答案 1 :(得分:1)
在我的情况下,我给了 0 .. << / strong>和 dictionary.count
之间的空格正确的是:
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#>)
}