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!

Find and replace an ampersand...

807605Aug 30 2007 — edited Aug 31 2007
I am encoding special characters in my HTML

i.e.

replacing & with &

and � with &pound etc.

I have managed to find and replace all of the using

String.replaceAll('xx'xx');

However how do i do the ampersand? If i replace all instances of & with & its going to match £ and other & How do i get it to only change & only and none of the html entities that have already been replaced previously?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 28 2007
Added on Aug 30 2007
9 comments
1,095 views