≡ Menu

How to search a specific character in string dynamics ax

Last I have to logic that if text contain contains “-“ then validate the length of string 9 other wise at 8.

I did it with strscan function of X++ or dynamics ax 2012. Full code as follow.


Int found=0;

Str target=”Aliraza-zaidi”;

found = strscan(target,”-“,found,strlen(target));

//this function return the position of character if it found.

If (found!=0)


Info (“charater  found”);




Info (“character not found”);

{ 0 comments… add one }

Leave a Comment