I have a phone number String
that is formatted like this: +1 (123) 456-7890 and I want it to be changed to: 1234567890. How would I do that? I tried the code below but it still shows the same format.
let phone = phoneNumber.text?.replacingOccurrences(of: "[()\\s-]+", with: "", options: .literal, range: nil)
print("phone Number \(phone)")