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

Convert Call stack to readable format in D365FO X++

//Input --container _xppCallStack = xSession::xppCallStack();  Public static str POL_formatXppCallStack(container _xppCallStack, int _skipFr...