Search code examples
c#regexhtml-encode

How to use SSRS Expression


I am using expression to replace text as follow:

RegularExpressions.Regex.Replace("   <Test>", @"&(.|\n)*?;", " ");

which give result Test But i want result <Test>.


Solution

  • Why not simply this?

    string result = HttpUtility.HtmlDecode(input).Trim();
    

    Leave out the Trim if you want to keep those spaces.