'...' is not a postfix unary operator - Swift 3

Viewed 9757

I just want to remove one part of string .

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 

   }
2 Answers

In my case i given space between 0..< and dictionary.count

Correct one is :

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#>)
    }
Related