开发者

HTML parsing in Java

开发者 https://www.devze.com 2023-01-30 12:50 出处:网络
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 HT

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开发者_JAVA百科


URLDecoder:

java.net.URLDecoder.decode("%22Hello+World+%26+Hello+World%22", "UTF-8")

Update: Modified to pass in the encoding as the second parameter.

0

精彩评论

暂无评论...
验证码 换一张
取 消