Wednesday, 13 November 2019

How to decode/unescape/Special characters HTML in Dynamics AX 2012 / Dynamics 365 finance and operations

Below is the  simple job I have written in D365 for removing encoded values from a string. Usually we see this kind of encoded special characters in the API's.

class SW_HTMLDecode
    /// <summary>
    /// Runs the class with the specified arguments.
    /// </summary>
    /// <param name = "_args">The specified arguments.</param>
    public static void main(Args _args)
    {
        str input   = ' Test &amp; notes';
        str output  = System.Web.HttpUtility::HtmlDecode(input);
        ;

        info(output);
    }

}


Result  = Test & notes

@Rahul

No comments:

Post a Comment

Adding a newline into a string in C# and X++

Below is the sample code we can use for  adding a newline after every occurrence of "@" symbol in the string in C#   using System...