Well, if you want to match 'a' with 'z' with numbers from 1 to 26, you can subtract 'a' and add 1:
char c = 'e';
int nc = c - 'a' + 1;
EDIT:
To convert all characters of a given input string to integers, you can use an array to store integer values.
For instance:
String input = "over";
int[] numbers = input.length();
for (int i=0; i<input.length(); i++)
numbers[i] = input.charAt(i) - 'a' + 1;
System.out.println(Arrays.toString(numbers));
source
share