SPHttpUtility.ConvertSimpleHtmlToText Method (Microsoft.SharePoint.Utilities)
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)
Syntax

Visual Basic (Declaration)
Public Shared Function ConvertSimpleHtmlToText ( _
    html As String, _
    maxLength As Integer _
) As String
Visual Basic (Usage)
Dim html As String
Dim maxLength As Integer
Dim returnValue As String

returnValue = SPHttpUtility.ConvertSimpleHtmlToText(html, maxLength)
C#
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.
Remarks

The ConvertSimpleHtmlToText method has unspecified behavior if the input string is not a value from a Windows SharePoint Services rich text field.

See Also

Tags :


Page view tracker