Created
May 10, 2015 21:56
-
-
Save TheJoshGriffith/621d1c8ba99908fe965d to your computer and use it in GitHub Desktop.
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
/** | |
* If the parameter passed to the method is numerical or can be converted to a numerical value, | |
* we return true, otherwise we return false | |
*/ | |
public boolean canConvertToInteger(String value) | |
{ | |
try | |
{ | |
Integer.parseInt(value); | |
} | |
catch (Exception ex) | |
{ | |
return false; | |
} | |
return true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment