MagicCMS Documentation

StringHtmlExtensions..::..TruncateHtml Method (String, Int32)

Truncates a string containing HTML to a number of text characters, keeping whole words. The result contains HTML and any tags left open are closed.

Namespace:  System
Assembly:  MagicCMS.4.5 (in MagicCMS.4.5.dll)

Syntax


public static string TruncateHtml(
	this string html,
	int maxCharacters
)

Parameters

html
Type: String
The HTML.
maxCharacters
Type: Int32
The maximum characters.

Return Value

Resulting text.