I have the following code that works fine in Swift 2:
let myModifiedString = myOriginalString.replacingOccurrences(of: "
with: "",
options: .regularExpression,
range: Range(myOriginalString.characters.indices))
However, I am updating my code to Swift 3, and I get the error message "inout String" does not convert to input "String".
The error occurs in myOriginalString.characters.indices.
I saw that Swift 3 made some changes to how ranges are implemented, as well as some String functions. I just cannot find a short solution to solve the problem and convert this statement into the corresponding Swift 3 syntax. What is the correct Swift 3 syntax for the statement?
source
share