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
}
}
Also in Swift:
- how to change background color swift
- change textfield placeholder color swiftui
- swift date difference in days
- remove and element from array firebase swift 5
- loop key value swift
- how to select but not focus textfield swift
- create alert in swift
- remove all add TapGestureRecognizer swift
- replace character in swift
- horizontal slide segue swift
- swift switch
- swift enum
- number of characters in a string swift
- swift image button blue
- remove back button swift
- how to make box shadow swift
- run a function only once swift
- swift pass function as parameter
- swift access appdelegate from viewcontroller
- swift bring something to front of view
- swift how to call a function
- How to set back button text in Swift
- swift convert dictionary to json
- convert string to int swift