Powered By Blogger

How to get count of repeated characters from a string in AX2012

 static void repeatedCharecters(Args _args)

{ str subTextPrev,subTextAll,subText,subTextOne,text = "Subbbuuluuuuuu"; int i,j,k; ; for (i = 1 ; i <= strLen(text) ; i++) { subText = subStr(text, i, 1); k = 0; for (j = 1 ; j <= strLen(text) ; j++) { subTextOne = subStr(text, j, 1); if (subTextOne == subText) { k++; } } if (!strFind(subTextAll, subText, 1, strLen(text)))

{

if(k >= 2) { subTextAll += subText + int2Str(k) + "\n"; }

} } info(subTextAll); }


Keep Daxing!!

No comments:

Post a Comment

DisableStandredButton

 My requirement is to disable the delete button for journals that were posted:- After Posting the button is enabled fig:- Line level also th...