Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

HtmlUtilities.ConvertToText method

Applies to Windows and Windows Phone

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

Syntax


public static string ConvertToText(
  string html
)

Parameters

html

Type: System.String [.NET] | Platform::String [C++]

A String containing HTML-formatted data.

Return value

Type: System.String [.NET] | Platform::String [C++]

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.

Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.Data.Html
Windows::Data::Html [C++]

Metadata

Windows.winmd

DLL

Windows.Data.dll

See also

HtmlUtilities

 

 

Show:
© 2014 Microsoft. All rights reserved.