Here is what i am trying to do. I have a string :
String s="ch"
I convert it into a binary string in the following way
char ar[]=s.toCharArray();
StringBuilder sb= new StringBuilder("00"); /* i am appending to extra zeros because
when i convert "ch" to binary string it
consists of 14 characters(0s and 1s) and i
need them to be a multiple of 8, so i add 2
0s to make it 16)*/
String wm=" ";
for(char c:ar)
{
wm=Integer.toBinaryString((int)c);
sb.append(wm);
}
Now i want to convert this binary string back into character...such that i get back "ch" as the output. Can anyone help?