如何在GWT中使用字符串 [英] How to unescape string in GWT
本文介绍了如何在GWT中使用字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
$ b
import com.google.gwt.user。 client.ui.HTML;
字符串未转义=新的HTML(文本).getText();
I used SafeHtmlUtils.htmlEscape(text) and I want to use opposite function. Could you tell me if in gwt there is function like unescapeHtml()
解决方案
If (and please only if) you can trust the text not to contain malicious content, you can use
import com.google.gwt.user.client.ui.HTML;
String unescaped = new HTML(text).getText();
这篇关于如何在GWT中使用字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文