Saturday, December 31, 2011

Is All Numeric?


<< Previous Table of Categories Next >>


 
  /**
   * Feel free to copy and use this method
   * If you have any comments or better solutions, please paste on my blog: 
   * http://blog.yanmingyu.com
   * or email me feedback.andrewyu@gmail.com
   *
   * This method uses Regular Expression to check if a string just contains numeric
   *
   */
  public static boolean  isAllNumeric(String s)
  {
    return s.matches("\\d+");
  }

No comments:

Post a Comment