let aString = "This is my string"
let newString = aString.replacingOccurrences(of: " ", with: "+", options: .literal, range: nil)
extension String {
func withReplacedCharacters(_ oldChar: String, by newChar: String) -> String {
let newStr = self.replacingOccurrences(of: oldChar, with: newChar, options: .literal, range: nil)
return newStr
}
}