开发者

is there any way to decode string? [duplicate]

开发者 https://www.devze.com 2023-02-10 23:33 出处:网络
This question already has answers here: Closed 11 years ago. Possible Duplicates: How can I Decode string?
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

精彩评论

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

关注公众号