Subscribe

RSS Feed (xml)

Powered By

Skin Design:
Free Blogger Skins

Powered by Blogger


Thursday, September 8, 2011

substr() function in Microsoft Dynamics AX X++

The substr function returns a part of a string. The first parameter is the original string, the second is the start position, and the third is the number of characters to read.

static void Datatypes_string_substr(Args _args)
{
str carBrand;
;
carBrand = "Volkswagen";
print substr(carBrand, 6, 5);
pause;
}

The print command from the method will display wagen as the substring starts at position 6 of the value of the first parameter, which is Volkswagen, and reads 5 characters ahead.

1 comment:

Archives