开发者

HTML parsing in Java

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜