Reputation: 8276
Basically if I have a string that looks like this:
%22Hello+World+%26+Hello+World%22
because I took it from HTML, how do I get Java to make this say Hello World & Hello World, aka replace the HTML pieces with text?
Thanks
Upvotes: 0
Views: 314
Reputation: 77536
URLDecoder:
java.net.URLDecoder.decode("%22Hello+World+%26+Hello+World%22", "UTF-8")
Update: Modified to pass in the encoding as the second parameter.
Upvotes: 4