SHARE
TWEET

Untitled

a guest Jan 8th, 2013 41 Never
  1. public boolean numCheck(String input, int number)
  2. {
  3.         if(number > input.length())
  4.         {
  5.                 // handle the case where the input String length is shorter than the number param
  6.                 return false;
  7.         }
  8.         // have to subtract one off the number as charAt is indexed starting at 0
  9.         if(Character.isDigit(input.charAt(number - 1))
  10.         {
  11.                 return true;
  12.         }
  13.         return false;
  14. }
RAW Paste Data
Top