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!

replacing hex values in a string

807588Apr 16 2009 — edited Apr 16 2009
When i try to write an incoming string to an xml file i get an exception containing the next message:

"0x1b is not a legal XML character."

0x1b is a hex char so all i have to do is replace it to get it to work:
                StringBuilder sb = new StringBuilder("0x1b");
                instructions = instructions.replace(sb, "");
in wich "instructions" is the string containing the hex.

yet it doesn't seem to work, i still get the same error.

Any suggestions on how to replace that 0x1b?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 14 2009
Added on Apr 16 2009
3 comments
5,420 views