StringExtensions.StripHtml method

Version 1.1.28
.NET Framework 4.8
Namespace Skybrud.Essentials.Strings.Extensions
Assembly Skybrud.Essentials.dll

StripHtml(string)

Extension method

Strips all HTML elements from the specified html string.

public static string StripHtml(this string html)

Parameters

html String

The input string containing HTML.

Returns

The input string without HTML markup.

StripHtml(string, String[])

Extension method

Strips all HTML elements from the specified html string, but keeps the HTML tags as specified in ignore.

public static string StripHtml(this string html, String[] ignore)

Parameters

html String

The input string containing the HTML.

ignore Array of String

An of tag names (without the brackets, like div) to ignore.

Returns

The stripped result.