swift string keep only numbers code example
Example: swift string keep only numbers
let result = string.trimmingCharacters(in: CharacterSet(charactersIn: "0123456789.").inverted)
let result = string.trimmingCharacters(in: CharacterSet(charactersIn: "0123456789.").inverted)