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,450
  • 9
  • 55
  • 111
C1rdec
  • 1,567
  • 1
  • 18
  • 45

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,450
  • 9
  • 55
  • 111