web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Count number of letters in string var?

(0) ShareShare
ReportReport
Posted on by 3,850

How can I count the numbers of digits in string var?

For example if the number of digits is more than 14 digits it will throw an error?

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Martin Dráb Profile Picture
    237,878 Most Valuable Professional on at

    strLen(strKeep('blah 1 blah 2', '0123456789'))

  • Community Member Profile Picture
    on at

    Hai,

         How  can i find number of upper case letters in given string?

    thanks,

    Suresh.N

  • Martin Dráb Profile Picture
    237,878 Most Valuable Professional on at

    A trivial approach would be something like strLen(strKeep(textToCheck, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')).

  • Suggested answer
    PA-22040759-0 Profile Picture
    6,194 on at

    Here is my take on finding the number of uppercase letters:

    static void Job5(Args _args)
    {
        str     txtToCheck = "ABCdefGHIjklm123ÆØÅ";
        int     i;
        Counter uppercaseLetters;
        
        for (i = 0; i < strLen(txtToCheck); i++)
        {
            if (System.Char::IsUpper(txtToCheck, i))
            {
                uppercaseLetters++;    
            }
        }
        
        info (strFmt("The string '%1' has %2 uppercase letters", txtToCheck, uppercaseLetters));
    }


  • In AX2012 in the InventOnHandItemListPage I need to be able to f Profile Picture
    499 on at

    Hi Palle

    how to check for number of commas in the string

  • Suggested answer
    PA-22040759-0 Profile Picture
    6,194 on at

    Martin kind of answered that above, but you could do like this:

    static void commas(Args _args)
    {
        str stringWithCommas = 'Here, is a string with commas (,)';
        
        info (strFmt("The string has %1 commas", strLen(strKeep(stringWithCommas, ','))));
    }


  • In AX2012 in the InventOnHandItemListPage I need to be able to f Profile Picture
    499 on at

    Hi Palle

    thank you very much it worked...

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Priya_K Profile Picture

Priya_K 4

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#3
Ali Zaidi Profile Picture

Ali Zaidi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans