Search snippets
Browse Code Answers
FAQ
Usage docs
Log In
Sign Up
Home
Swift
swift replace all characters except numbers
Jose Ospina
Programming language:
Swift
2021-03-01 02:38:57
0
Q:
swift replace all characters except numbers
Shatrughna
Code:
Swift
2021-03-01 02:43:09
let result = string.trimmingCharacters(in: CharacterSet(charactersIn: "0123456789.").inverted)
0
Tags
number
replace
character
characters
Related
swift textfield trim special characters before database
swift remove space from string
how to replace certain characters in string swift
swift apply changes after a word in string
swift replace newlines with space
replace character in swift
How do I check if a string contains another string in Swift
swift string keep only numbers
swift uitextfield only numbers keyboard lock programmatically
find range of string swift
swift negative line spacing
remove last character from string swift
number of characters in a string swift
New to Communities?
Join the community