UCE Docs / html_escape

Signature

String html_escape(String s)

Parameters

s : string to be escaped
return value : an HTML-safe escaped version of 's'

Returns a version of the input string where special HTML characters are replaced by entities:

  • & becomes &

  • < becomes &lt;

  • > becomes &gt;

  • " becomes &quot;

Example

print(html_escape("<b>Tom & Jerry</b>"), "\n");
Output
&lt;b&gt;Tom &amp; Jerry&lt;/b&gt;