Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Replace one ASCII value to other ASCII value

802235May 30 2011 — edited Jun 1 2011
Hi 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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 29 2011
Added on May 30 2011
13 comments
7,555 views