Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SWIFT

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
	}
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #replace #character #swift
ADD COMMENT
Topic
Name
7+2 =