The Html Agility Pack is equiped with a utility class called HtmlEntity
. It has a static method with the following signature:
/// <summary>
/// Replace known entities by characters.
/// </summary>
/// <param name="text">The source text.</param>
/// <returns>The result text.</returns>
public static string DeEntitize(string text)
It supports well-known entities (like
) and encoded characters such as '
as well.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…