Using only swift code I cant figure out how to take \"(555) 555-5555\" and return only the numeric values and get \"5555555555\". I need to remove all the parentheses, whit
I found the best solution with filter function. Please have a look into it.
let string = "(555) 555-5555" let onlyDigits = string.filter({ (char) -> Bool in if Int("\(char)") != nil { return true } else { return false } })