On Tue, Sep 2, 2008 at 7:28 PM, Gabriel Reis <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Is there any tool to verify if a String is escaped? Something like this:
>
> assertFalse( StringEscapeUtils.isHtmlEscaped("<b>text</b>") );
>
> assertTrue( StringEscapeUtils.isHtmlEscaped("<b>text</b>") );
Perhaps one way to do this is to use the StringEscapeUtils's
unescapeHtml() method and compare if the result equals the original.
something like...
if (value.equals(StringEscapeUtils.unescapeHtml(value))) {
...
}
http://commons.apache.org/lang/api-release/org/apache/commons/lang/StringEscapeUtils.html#unescapeHtml(java.lang.String)
Niall
> []s
> Gabriel
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]