First of, sorry for the poor title, I dont know how to describe it in a better way.
My problem is as follows. I have a string where I need to do the vm's escape evalutation twice.
One time evalutation:
output:String s = "\b"; System.out.println(s.charAt(0)); System.out.println((int) s.charAt(0));
The wm reads the escape (when the string gets autoboxed I think) and translate it into backslash, with the charcode 8. All is as espected.
However, I need to redo the evaluation, so that can get the same result but from the string "\\b".
output:String s = "\\b"; System.out.println(s.charAt(0)); System.out.println(s.charAt(1)); String s2 = "" + s.charAt(0) + s.charAt(1); //Here is where, I need to re evaluate the escape //Instead i get the "\b" System.out.println(s2);
I also tried
output:String s = "\\b"; char a = s.charAt(0); char b = s.charAt(1); char c = (char) (a + b); System.out.println(c); System.out.println((int) c);
Can this even be done? Hope there is an idea out there. Thanks in advance