I am trying to parse text and trying to remove some characters.
This doesn't seem to work:
string.replacingOccurrences(of: "‘", with: "'")
string.replacingOccurrences(of: "“", with: "\"")
Any help is resolving this would be excellent!
Thank you.
I am trying to parse text and trying to remove some characters.
This doesn't seem to work:
string.replacingOccurrences(of: "‘", with: "'")
string.replacingOccurrences(of: "“", with: "\"")
Any help is resolving this would be excellent!
Thank you.
String.replacingOccurrences returns a new instance of the string with the changes made, hence you need to assign and use that new string:
string = string.replacingOccurrences(of: "‘", with: "'")
string = string.replacingOccurrences(of: "“", with: "\"")
Or, perhaps more in style:
string = string.replacingOccurrences(of: "‘", with: "'")
.replacingOccurrences(of: "“", with: "\"")