how to replace letters in a string swift code example
Example: replace character in swift
extension String {
func withReplacedCharacters(_ oldChar: String, by newChar: String) -> String {
let newStr = self.replacingOccurrences(of: oldChar, with: newChar, options: .literal, range: nil)
return newStr
}
}