Skip to content

HtmlDecode

Maarten Hilferink edited this page Apr 8, 2026 · 1 revision

String functions HtmlDecode

The HtmlDecode function decodes HTML-encoded strings back to their original form.

syntax

HtmlDecode(strings: E->String) -> E->String

definition

Converts HTML-encoded strings back to their original format by replacing HTML entity references with the corresponding characters:

Entity Character
&lt; <
&gt; >
&amp; &
&quot; "
&#39; '
&nbsp; (space)

Also decodes numeric character references like &#60; and &#x3C;.

arguments

argument description type
strings HTML-encoded strings to decode E->String

performance

Time complexity: O(n × L) where n is the number of strings and L is the average string length.

Decoded strings are typically slightly shorter than input strings.

example

unit<uint32> HtmlContent: nrofrows = 3;
attribute<String> encoded (HtmlContent) := union_data(HtmlContent,
    'Hello &lt;world&gt;',
    'A &amp; B',
    'Quote: &quot;test&quot;'
);

attribute<String> decoded (HtmlContent) := HtmlDecode(encoded);
// decoded = {'Hello <world>', 'A & B', 'Quote: "test"'}

use cases

  • Processing data extracted from HTML sources
  • Converting HTML content to plain text
  • Cleaning up HTML entity artifacts in imported data

see also

since version

7.0

Clone this wiki locally