Skip to content

Instantly share code, notes, and snippets.

@fmendozaro
Last active September 22, 2017 16:37
Show Gist options
  • Save fmendozaro/6b145c34955c84ffceb8cd03d5e6b64b to your computer and use it in GitHub Desktop.
Save fmendozaro/6b145c34955c84ffceb8cd03d5e6b64b to your computer and use it in GitHub Desktop.
Java Strings Bonus exercise

Java Strings Bonus exercise

Get rid of the () and - from a phone number format, keep only a String with just the numbers, then grab only the area code (the first 3 digits).

Example

Input:

(210) 123-4560

Output:

2101234560, area code: 210

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment