View RSS Feed

My Java Tips

  1. Handling ASCII character set in Java

    by , 11-19-2011 at 07:11 PM (My Java Tips)
    In this post, I will talk about ASCII character set and how to deal with ASCII codes in Java.

    ASCII character uses 7 bits for character representation. This means that there are total of 128 characters supported by ASCII set. Point to note is that there are only 93 printable characters in ASCII whose ASCII codes are from 33 till 126.

    Java supports all popular character including UTF. But sometimes you only want the input to comprise of ASCII printable characters. This ...
  2. Validating ASCII character set

    by , 11-17-2011 at 08:04 PM (My Java Tips)
    In this post, I will write about how to validate characters of ASCII characterset.

    ASCII is a well know character set. It is a 7 bit character set and represents 128 characters. The printable character codes range from 33 to 126 inclusive. Sometimes you want to make sure that your strings do not contains non ASCII printable character. This is easy and can be done by writing a method for this.

    Review the static method below. It takes an ArrayList of String type and after ...