开发者

is there any way to decode string? [duplicate]

This question already has answers here: Closed 11 years ago.

Possible Duplicates:

How can I Decode string?

Java: How to decode HTML character entities in Java like HttpUtility.HtmlDecode?

Hi,

I have string like as an eg "äså" that needs to be converted like this "äså" pls help开发者_高级运维 me out here.

Thanks in advance


Have a look at the StringEscapeUtils class in the Apache Commons library. (Specifically the unescapeHtml method).

import org.apache.commons.lang.StringEscapeUtils;

public class Test {
    public static void main(String[] args) {
        String str = "äså";
        System.out.println(StringEscapeUtils.unescapeHtml(str)); // prints äså
    }
}
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜