Decodes a string containing HTML numeric character references or HTML character entity references and returns the decoded string
Category: Web Tools
HTMLDECODE ( expression )
expression
specifies any character expression.
The HTMLDECODE function recognizes the following character entity references:
Character entity reference | decoded character |
---|---|
& | & |
< | < |
> | > |
" | " |
' [*] | ' |
[*] (SAS 9 only) |
Unrecognized entities (&< name >;) are left unmodified in the output string.
The HTMLDECODE function recognizes numeric entity references that are of the form
& #nnn; | where nnn specifies a decimal number that contains one or more digits. |
& #Xnnn; | where nnn specifies a hexadecimal number that contains one or more digits. |
Operating Environment Information: Numeric character references that cannot be represented in the current SAS session encoding will not be decoded. The reference will be copied unchanged to the output string.
SAS Statements | Results |
---|---|
x1=htmldecode('not a & lt;tag & gt;'); | not a < tag > |
x2=htmldecode(' & amp;); | ' & ' |
x3=htmldecode ('ABC'); | 'ABC' |
Function:
'HTMLENCODE Function' on page 581