Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Answered

How to split a sentence into 2 part after 5th space in ax 2012?

(0) ShareShare
ReportReport
Posted on by 80

Hi all,

I'm new to ax.

Can you please help me to split a sentence into 2 part after 5th space?

  • Vidhushan S Profile Picture
    Vidhushan S 80 on at
    RE: How to split a sentence into 2 part after 5th space in ax 2012?

    Thank you so much Sir.

    I'm using the approach which you have mentioned first.

    It's working.

    Thank you

  • Verified answer
    Martin Dráb Profile Picture
    Martin Dráb 230,836 Most Valuable Professional on at
    RE: How to split a sentence into 2 part after 5th space in ax 2012?

    One possible solution is using strFind() to find spaces one by one. Then you can use subStr() to take those two parts.

    Another approach is using strSplit() to get words between spaces. The you can iterate the list and create two strings - one with the first five elements and another with the rest. Note that you'll need to add spaces between words.

    Yet another approach would be using regular expressions, but I think you should rather stick to native X++ functions.

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,965 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,836 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans