swift 5 remove not number code example
Example: swift replace all characters except numbers
let result = string.trimmingCharacters(in: CharacterSet(charactersIn: "0123456789.").inverted)
let result = string.trimmingCharacters(in: CharacterSet(charactersIn: "0123456789.").inverted)