EntityHelper Class

Helper class to decode an entity.

public static class EntityHelper

Methods

NameDescription
DecodeEntity(int)Decodes the given UTF-32 character code to the matching set of UTF-16 characters.
DecodeEntity(ReadOnlySpan<char>)Decodes the given HTML entity to the matching Unicode characters.

DecodeEntity overloads

DecodeEntity(int)

EntityHelper.cs

Decodes the given UTF-32 character code to the matching set of UTF-16 characters.

public static string DecodeEntity(int utf32)
Parameters
utf32 int
Returns

string The unicode character set or null if the entity was not recognized.

DecodeEntity(ReadOnlySpan<char>)

EntityHelper.cs

Decodes the given HTML entity to the matching Unicode characters.

public static string? DecodeEntity(ReadOnlySpan<char> entity)
Parameters
entity ReadOnlySpan<char>
The entity without & and ; symbols, for example, copy.
Returns

string? The unicode character set or null if the entity was not recognized.