Answers for "how to replace letters in a string swift"

1

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
	}
}
Posted by: Guest on February-06-2020

Code answers related to "how to replace letters in a string swift"

Code answers related to "Swift"

Browse Popular Code Answers by Language