Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public boolean numCheck(String input, int number)
- {
- if(number > input.length())
- {
- // handle the case where the input String length is shorter than the number param
- return false;
- }
- // have to subtract one off the number as charAt is indexed starting at 0
- if(Character.isDigit(input.charAt(number - 1))
- {
- return true;
- }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement