I am looking for a way to replace characters in a Swift String.
String
Example: \"This is my string\"
I would like to replace \" \" with \"+\" to get \
Here is the example for Swift 3:
var stringToReplace = "This my string" if let range = stringToReplace.range(of: "my") { stringToReplace?.replaceSubrange(range, with: "your") }