convert the characters of a string into its respective sequential alphabetic number
Eg: String str="Hey you"; output: str = 8 5 24 24 15 21 This is the code i've tried and i guess this code might be quite complex.But still am a newbie this is something that i could do at its extreme. And now coming to the point, i need a statement that swaps the value of character of the given string into the respective number 'j' as you see in the program. note: got to work at line number 18. ArrayList<Character> alp=new ArrayList<>(); char x='a'; for(x='a';x<='z';x++) { alp.add(x); } String y="Hi there dood"; String z=y.toLowerCase(); int i,j; for(i=0;i<26;i++) { int m=z.charAt(0); int n; n=m-'a'+1; System.out.println(n); for(j=1;j<=26;j++) { if(n==j) { int k='j'; char c=(char)k; z.charAt(i)='c'; }