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

Copy Markup charges while posting purchase invoice using X++

 Copy Markup charges while posting purchase invoice using X++ Class: Important: Code logic is just for Reference.  New class => Duplicate...