is there any way to decode string? [duplicate]
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å
}
}
精彩评论