Java tutorial
//package com.java2s; public class Main { public static String stringToAscii(String val) { StringBuffer stringBuffer = new StringBuffer(); char[] chars = val.toCharArray(); for (int i = 0; i < chars.length; i++) { stringBuffer.append((int) chars[i]); } return stringBuffer.toString(); } }