有没有什么办法去code字符串?字符串、有没有什么、办法、code

由网友(十里长街走马)分享简介:可能显示的文件: 我怎么能德code字符串? Java:如何去在Java中code HTML字符实体像HttpUtility.HtmlDe code? Possible Duplicates:How can I Decode string?Java: How to decode HTML character enti...

可能显示的文件:   我怎么能德code字符串?   Java:如何去在Java中code HTML字符实体像HttpUtility.HtmlDe code?

Possible Duplicates: How can I Decode string? Java: How to decode HTML character entities in Java like HttpUtility.HtmlDecode?

您好,

我有串等作为例如&ampauml; S&amparing;需要转换像这样的ASA请帮我在这里

I have string like as an eg "äså" that needs to be converted like this "äså" pls help me out here.

在此先感谢

推荐答案

有一个看的 StringEscapeUtils 在Apache共享库类。 (具体地 unescapeHtml 法)。

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å
    }
}
阅读全文

相关推荐

最新文章