Source Code : Utility methods for ASCII character checking.

Java Is Open Source Programming Language You Can Download From Java and Java Libraries From http://www.oracle.com. Click Here to download
We provide this code related to title for you to solve your developing problem easily. Libraries which is import in this program you can download from http://www.oracle.com. Click Here or search from google with Libraries Name you get jar file related it

Utility methods for ASCII character checking.

   
/**
 * Utility methods for ASCII character checking.
 */
public class ASCIIUtil {

  /**
   * Checks whether the supplied character is a letter or number.
   */
  public static boolean isLetterOrNumber(int c) {
    return isLetter(c) || isNumber(c);
  }

  /**
   * Checks whether the supplied character is a letter.
   */
  public static boolean isLetter(int c) {
    return isUpperCaseLetter(c) || isLowerCaseLetter(c);
  }

  /**
   * Checks whether the supplied character is an upper-case letter.
   */
  public static boolean isUpperCaseLetter(int c) {
    return (c >= 65 && c <= 90); // A - Z
  }

  /**
   * Checks whether the supplied character is an lower-case letter.
   */
  public static boolean isLowerCaseLetter(int c) {
    return (c >= 97 && c <= 122);  // a - z
  }

  /**
   * Checks whether the supplied character is a number
   */
  public static boolean isNumber(int c) {
    return (c >= 48 && c <= 57); // 0 - 9
  }
}

   
    
    
  

Thank with us