Share via


HttpUtility.HtmlEncode Method (String)

Encodes the specified string for use as text between HTML tags, or as an attribute value inside an HTML tag.

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

Syntax

'Declaration
Public Shared Function HtmlEncode ( _
    valueToEncode As String _
) As String
'Usage
Dim valueToEncode As String
Dim returnValue As String

returnValue = HttpUtility.HtmlEncode(valueToEncode)
public static string HtmlEncode(
    string valueToEncode
)

Parameters

Return Value

Type: System.String
A String representation of the encoded value.

Remarks

The HtmlEncode(String) method replaces the ampersand (&), double-quotation (“”), single-quotation (‘’), less-than (≤), and greater-than (≥) characters with the appropriate characters.

See Also

Reference

HttpUtility Class

HttpUtility Members

HtmlEncode Overload

Microsoft.SharePoint.Client.Utilities Namespace