Last active
March 15, 2016 02:00
-
-
Save rafaelwkerr/5296d9cb4411f661fdfe to your computer and use it in GitHub Desktop.
A method to extract just numbers from some string
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public String selectNumbers(String someString) { | |
if (someString != null) { | |
return someString.trim().replaceAll("[^0-9]", ""); | |
} else { | |
return null; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment