SPHttpUtility.ConvertSimpleHtmlToText method

Converts an HTML string from a Microsoft SharePoint Foundation rich text field to plain text.

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

Syntax

'Declaration
Public Shared Function ConvertSimpleHtmlToText ( _
    html As String, _
    maxLength As Integer _
) As String
'Usage
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
    Type: System.String

    An HTML string that contains the contents of a Microsoft SharePoint Foundation rich text field.

  • maxLength
    Type: System.Int32

    A 32-bit integer representing the maximum desired length of the returned string, or -1 to specify no maximum length.

Return value

Type: System.String
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 Microsoft SharePoint Foundation rich text field.

See also

Reference

SPHttpUtility class

SPHttpUtility members

Microsoft.SharePoint.Utilities namespace