StringUtils.HighlightKeywords method

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

HighlightKeywords(string, string, IEnumerable<T>)

Static

Highlights specified keywords in the input string with the specified className by using a <span> element.

public static string HighlightKeywords(string input, string className, IEnumerable<T> keywords)

Parameters

input String

The input string.

className String

The class name.

keywords IEnumerable<T>

The keywords to highlight.

Returns

The input string with highlighted keywords.

HighlightKeywords(string, string, String[])

Static

Highlights specified keywords in the input string with the specified className by using a <span> element.

public static string HighlightKeywords(string input, string className, String[] keywords)

Parameters

input String

The input string.

className String

The class name.

keywords Array of String

The keywords to highlight.

Returns

The input string with highlighted keywords.