After a lot of searching, I am unable to find what i am looking for
I have 2 questions like:
String str = "Hello"
Now I want its value in long
072101108108111L
where Ascii
072 = H
101 = e
108 = l
108 = l
111 = o
makes Hello
.
How can I do this and then convert it back to string?
For example if I have a long value
072101108108111L
then how can I get back the string "Hello" in java?
here is where I am at:
I can get string to long like this
String str = "Hello";
StringBuilder sb = new StringBuilder();
for (char c : str.toCharArray())
sb.append((int)c);
BigInteger mInt = new BigInteger(sb.toString());
String valu = mIn.tostring();
but value is 72 for "H"; I want it to be 072 so that the result is 3 characters, so that it fits the function to convert back to String.
Any help plz