HtmlUtilities.ConvertToText(String) Method


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

 static Platform::String ^ ConvertToText(Platform::String ^ html);
 static winrt::hstring ConvertToText(winrt::hstring const& html);
public static string ConvertToText(string html);
function convertToText(html)
Public Shared Function ConvertToText (html As String) As String



A String containing HTML-formatted data.



A String of text content.


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.

Applies to