HttpUtility.HtmlDecode Method

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Converts a string that has been HTML-encoded (for HTTP transmission) into a decoded string.

Namespace:  System.Net
Assembly:  System.Windows (in System.Windows.dll)

Syntax

'Declaration
Public Shared Function HtmlDecode ( _
    html As String _
) As String
public static string HtmlDecode(
    string html
)

Parameters

Return Value

Type: System.String
A decoded string.

Remarks

Strings that contain HTML-encoded, character-entity equivalents such as < and > are displayed as text, not as HTML code, unless they are decoded.

A browser displays the following as a string of text:

<p> Hello world >/p<

However, if the string is decoded first, the browser displays it as follows and recognizes the paragraph tag:

<p> Hello world </p>

Version Information

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.