Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@alexbosworth
Created January 28, 2015 06:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexbosworth/dcc601657cbd37758099 to your computer and use it in GitHub Desktop.
Save alexbosworth/dcc601657cbd37758099 to your computer and use it in GitHub Desktop.
let phoneNumber = "(408) 555-5270"
let cleanedPhoneNumber = phoneNumber.componentsSeparatedByCharactersInSet(NSCharacterSet.decimalDigitCharacterSet().invertedSet).reduce("", +)
// 4085555270
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment