2

How can I unescape a string that contains &#xxx; ?

Example:

"Quelque petite scratch sur lécran"

"Quelque petite scratch sur lécran"

è | è

é | é

Fredou
  • 19,848
  • 10
  • 58
  • 113
C1rdec
  • 1,647
  • 1
  • 21
  • 46

1 Answers1

4

WebUtility.HtmlDecode should do the trick, example

using System;
using System.Net;

public class Program
{
    public static void Main()
    {
        string b = WebUtility.HtmlDecode("Quelque petite scratch sur lécran");

        Console.WriteLine("After HtmlDecode: " + b);

    }
}

https://dotnetfiddle.net/148gYR

Fredou
  • 19,848
  • 10
  • 58
  • 113