The code snippet nelow shows how to extract Ascii codes from a String.

 String test = "ABCD";
     for ( int i = 0; i < test.length(); ++i ) {
       char c = test.charAt( i );
       int j = (int) c;
       System.out.println(j);
       }