HtmlHelper Class

Helper to parse several HTML tags.

public static class HtmlHelper

Methods

NameDescription
EscapeUrlCharacter(char)Performs the escape url character operation.
ScanEntity<T>(T, int, int, int)Scans an entity. Returns number of chars matched.
TryParseHtmlTag(StringSlice, string?)Attempts to parse html tag.
Unescape(string?, bool)Destructively unescape a string: remove backslashes before punctuation or symbol characters.

EscapeUrlCharacter(char)

HtmlHelper.cs

Performs the escape url character operation.

public static string? EscapeUrlCharacter(char c)

Parameters

c char

Returns

string?

ScanEntity<T>(T, int, int, int)

HtmlHelper.cs

Scans an entity. Returns number of chars matched.

public static int ScanEntity<T>(T slice, out int numericEntity, out int namedEntityStart, out int namedEntityLength) where T : ICharIterator

Type parameters

T

Parameters

slice T
numericEntity int
namedEntityStart int
namedEntityLength int

Returns

int

TryParseHtmlTag(StringSlice, string?)

HtmlHelper.cs

Attempts to parse html tag.

public static bool TryParseHtmlTag(ref StringSlice text, out string? htmlTag)

Parameters

text StringSlice
htmlTag string?

Returns

bool

Unescape(string?, bool)

HtmlHelper.cs

Destructively unescape a string: remove backslashes before punctuation or symbol characters.

public static string Unescape(string? text, bool removeBackSlash = true)

Parameters

text string?
The string data that will be changed by unescaping any punctuation or symbol characters.
removeBackSlash bool
if set to true [remove back slash].

Returns

string