SPEncode.HtmlEncode Method
Encodes the specified string so that special characters used in HTML are encoded as HTML entities.
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 HtmlEncode ( _
str As String _
) As String
'Usage
Dim str As String
Dim returnValue As String
returnValue = SPEncode.HtmlEncode(str)
public static string HtmlEncode(
string str
)
Parameters
str
Type: System.StringThe string to encode.
Return Value
Type: System.String
The encoded version of the string that is passed to the method.
Remarks
The HtmlEncode method converts characters to entities as follows:
< to <
> to >
& to &
" to "
' to '