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 :
Small and medium business | Business Central, N...
Suggested Answer

Extract string before seperator

(0) ShareShare
ReportReport
Posted on by 1,638

We have a variable n: code[20]

where n := 'SCI007.001';

Need to extract the only SCI007 i.e before the seperator (dot) 

Any suggestions ? 

I have the same question (0)
  • Suggested answer
    JAngle Profile Picture
    133 on at

    Use this docs.microsoft.com/.../text-strpos-method

    Then you know the position and you can copystr

  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,111 Moderator on at

    You can try this:

    trigger OnRun()

       var

           mytext: Text;

           mynewtext: text;

       begin

           mytext := 'SCI007.001';

           mynewtext := copystr(mytext, 1, (StrPos(mytext, '.') - 1));

           Message(mynewtext);

       end;

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 > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,151

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,443 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,092 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans