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)

How to remove first word from string

(0) ShareShare
ReportReport
Posted on by

How to remove first word from string in AX 2012  run time, 

First can be of any length, requirement is to remove or delete the first word of the string dynamically,

we have string function but haven't found any function that removes/deletes first word from string, (do not want to hard coded words, needs run time),

Please do needful,

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    axk Profile Picture
    925 on at

    You have to find index of first space (" ") - strFind(), and get substring from your string, starting from space index - subStr().

  • Gautam Profile Picture
    3,945 on at

    Hi Akbarpasha,

    you can use something like this:-

    strDel("qwerty",1,1)

    output - werty

    put required string instead of "qwerty".

    Thanks

    Gautam

  • Suggested answer
    Community Member Profile Picture
    on at

       str st = 'A B C D';

       str s;

       container con;

       con = str2con(st, ' ');

       con = conDel(con, 1,1);

       s = strReplace(con2Str(con), ',', ' ');

       info(s);

  • Suggested answer
    PA-22040759-0 Profile Picture
    6,194 on at
    static void RemoveFirstWord(Args _args)
    {
        str testString = 'This is a test';
        str newString; 
        int firstSpace = strFind(testString, ' ', 1, strLen(testString));
        
        if (firstSpace)
        {
            newString = subStr(testString, firstSpace + 1, strLen(testString));
        }
        
        info (newString);
    }

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!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Joris dG Profile Picture

Joris dG 5

#2
Andrew Jones a1x Profile Picture

Andrew Jones a1x 2

#3
Basit Profile Picture

Basit 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans