Friday, 4 July 2014

convert string to ascii value

this is example of StringToAscii convertion in java.

string get character java ascii to value

package com.vipul;

public class StringToAscii {
      public static void main(String[] args) {

            char character = 'a';
            int ascii = (int) character;
            System.out.println("ascii is"+ascii);
      }
}


Output is ::
================================
ascii is:97
================================

No comments:

Post a Comment