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

Announcements

No record found.

News and Announcements icon
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
    239,029 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
    239,029 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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Joris dG Profile Picture

Joris dG 5

#2
Alexey Lekanov Profile Picture

Alexey Lekanov 2

#2
Henrik Nordlöf Profile Picture

Henrik Nordlöf 2 User Group Leader

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans