SPHttpUtility.HtmlDecode method (String, Boolean)

Decodes a string that was encoded by the HtmlEncode(String) method.

Namespace:  Microsoft.SharePoint.Utilities
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'Declaration
Public Shared Function HtmlDecode ( _
    valueToDecode As String, _
    decodeNbsp As Boolean _
) As String
'Usage
Dim valueToDecode As String
Dim decodeNbsp As Boolean
Dim returnValue As String

returnValue = SPHttpUtility.HtmlDecode(valueToDecode, _
    decodeNbsp)
public static string HtmlDecode(
    string valueToDecode,
    bool decodeNbsp
)

Parameters

  • valueToDecode
    Type: System.String

    The HTML string to be decoded.

  • decodeNbsp
    Type: System.Boolean

    true to specify that the character entities   and   should be decoded as whitespace.

Return value

Type: System.String
Returns the decoded string. If valueToDecode is an empty string, this method returns an empty object. If valueToDecode is null, this method returns null.

Remarks

To encode an HTML string, use the HtmlEncode(String) method. To decode an HTML string encoded by HtmlEncode(String) without decoding the   and   character entities as whitespace, use the HtmlDecode(String) method.

See also

Reference

SPHttpUtility class

SPHttpUtility members

HtmlDecode overload

Microsoft.SharePoint.Utilities namespace