Replace one ASCII value to other ASCII value
802235May 30 2011 — edited Jun 1 2011Hi all,
I have one requirement i.e. I have to pass a string to method. The method should replace ascii character with some another ascii character.
I took the hexdecimal equivalent of the particular ascii and wrote a regex.
Eg: To convert ASCII char having hex value 89 to ASCII char having hex value 25
I used replaceAll(str.replaceAll("[\\x89]", ?);
I cannot get what put in the place of ?. \\x89 is a regex. ascii char for hex value 89 is ‰ ascii char for hex value 25 is %
Kindly help me in this regard