HtmlUtilities HtmlUtilities HtmlUtilities Class

Definition

Provides utility methods for use with HTML-formatted data.

public : static class HtmlUtilities
public static class HtmlUtilities
Public Static Class HtmlUtilities
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

Note

This class is not agile, which means that you need to consider its threading model and marshaling behavior. For more info, see Threading and Marshaling (C++/CX) and Using Windows Runtime objects in a multithreaded environment (.NET).

Methods

ConvertToText(String) ConvertToText(String) ConvertToText(String)

Converts HTML-formatted data to a string that contains the text content extracted from the HTML.

public : static Platform::String ConvertToText(Platform::String html)
public static string ConvertToText(String html)
Public Static Function ConvertToText(html As String) As string
Parameters
html
Platform::String String String

A String containing HTML-formatted data.

Returns
Platform::String string string

A String of text content.

Remarks

The ConvertToText method is used to convert HTML-formatted data to a text string. The HTML-formatted data could represent an HTML document or an HTML fragment. When the ConvertToText method parses the HTML-formatted data, no scripts are run and no secondary downloads occur (scripts, images, and stylesheets, for example).

The ConvertToText method will only parse HTML-formatted data to extract the text. If the html parameter contains a non-HTML string (XML or SVG, for example), then the return value will contain an empty string. If the html parameter contains a string that represents an HTML Frameset document, then the return value will contain an empty string.