How to decode String which contains characters like 'Total\x20Value' my actual value is 'Total Value'
Using javascript it is getting decoded by the browser like:
if I write on browser console:
var a = 'Total\x20Value';
then I print a then it will print 'Total Value' mean browser decoded this string automatically
Now my question is how can I do this in Java code, I want this string to be decoded in java code but I am not getting a way to decode it in Java. One more thing I can not go for string replace solution for this case because the given string only contains a space char but at run time I will get different characters so I need a generic solution in which I can decode any string without any replace operation.
One more string example is :
"DIMENSION\x5f13420895086619127059036175667828\x7e\x24\x7e1\x7e\x24\x7e1"
its real string is :
"DIMENSION_13420895086619127059036175667828~$~1~$~1".
Suggest something If it can be achieved in Java using some predefined class I have gone through with many solutions but nothing worked for me.