共用方式為


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)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online

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