Converts an HTML string from a Windows SharePoint Services rich text field to plain text.
Namespace: Microsoft.SharePoint.Utilities
Assembly: Microsoft.SharePoint (in microsoft.sharepoint.dll)
Visual Basic (Declaration)
Public Shared Function ConvertSimpleHtmlToText ( _
html As String, _
maxLength As Integer _
) As String
Dim html As String
Dim maxLength As Integer
Dim returnValue As String
returnValue = SPHttpUtility.ConvertSimpleHtmlToText(html, maxLength)
public static string ConvertSimpleHtmlToText (
string html,
int maxLength
)
Parameters
- html
An HTML string that contains the contents of a Windows SharePoint Services rich text field.
- maxLength
A 32-bit integer representing the maximum desired length of the returned string, or -1 to specify no maximum length.
Return Value
A plain-text string version of the string.
The ConvertSimpleHtmlToText method has unspecified behavior if the input string is not a value from a Windows SharePoint Services rich text field.