I\'m quite new to Java so I am wondering how do you convert a letter in a string to a number e.g. hello world would output as 8 5 12 12 15 23 15 18 12 4>
public static void main(String[] args) {
String s = "hello world";
s = s.replace(" ", "");
char[] c = s.toCharArray();
for (Character ss : c)
System.out.println(ss - 'a' + 1);
}