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)

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.

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

Show: