Saturday, 17 May 2014

Find a char in string and replace new char using x++ in Ax2012


In following example we are find a char i.e "," in string and replace this char with new one char i.e ".".

static void FindCharAndRepalce(Args _args)
{

    str a;
    int pos;
    ;
 
    a     = "100,00";
    pos =  strFind(a, ',',1, strLen(a));
    a     =  strDel(a,pos,1);
    a     =  strIns(a,'.',pos);
    info(strFmt("%1",a));
}

1 comment: