Search
 
SCRIPT & CODE EXAMPLE
 

SWIFT

how to replace certain characters in string swift

let aString = "This is my string"
let newString = aString.replacingOccurrences(of: " ", with: "+", options: .literal, range: nil)
Comment

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
	}
}
Comment

PREVIOUS NEXT
Code Example
Swift :: print an array in swift 
Swift :: swift button 
Swift :: power number in swift13 
Swift :: swiftui pull to refresh 
Swift :: Make a VStack fill the width of the screen in SwiftUI 
Swift :: unit testing swift ui 
Swift :: and in swift1 
Swift :: swift scrollview scroll to bottom 
Swift :: swiftui background color 
Swift :: difference between struct and class swift 
Swift :: swiftui 100 days 
Swift :: power swift 
Swift :: uitextview placeholder uikit ios 
Swift :: set in swift 
Swift :: imageliteral swiftui 
Swift :: sf symbols 
Swift :: find range of string swift 
Swift :: swiftui radio button 
Swift :: swift extension Array of element 
Swift :: swiftui check available ios 
Swift :: abstract class in swift 
Swift :: how to send a file from file manager in mail swift 
Swift :: swift sf symbol uiimage size 
Swift :: Swift Join Two Strings 
Swift :: async await apis for ios 13 
Swift :: swift core data order by 
Swift :: star score rating swiftui 
Swift :: how to decode optional bool swift 
Swift :: swift string pad 
Swift :: Swift Conforming Multiple Protocols 
ADD CONTENT
Topic
Content
Source link
Name
2+2 =