Friday, March 21, 2014

Format String Special Character

// Format String Special Character

static void formatString(Args _args)
{
    str value = "   Hello \t Sangeeth        \n Welcom to Dynamics AX";
    str replace(str _source, str _what, str _with)
    {
        int found = 0;
        str target = _source;
        ;
        do
        {
            found = strscan(target, _what, found, strlen(target));
            if (found != 0)
            {
                target = strdel(target, found, strlen(_what));
                target = strins(target, _with, found);
                found += strlen(_with);
            }
        } while (found != 0);
        return target;
    }
    ;
    info(value);
    value = replace(value, '\n', ");
    value = replace(value, '\r', ");
    value = replace(value, '\t', ");
    value = replace(value, ' ', ");
    info(value);
}

No comments:

Post a Comment

Disabling the flight in D365FO (CHD - Tier 1)

 INSERT INTO dbo.SYSFLIGHTING(FLIGHTNAME, ENABLED)  VALUES ('<FlightObjectName>_KillSwitch', 1)  or  INSERT INTO dbo.SYSFLIGHT...