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,636

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 ? 

  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,029 Moderator on at
    RE: Extract string before seperator

    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;

  • Suggested answer
    JAngle Profile Picture
    95 on at
    RE: Extract string before seperator

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

    Then you know the position and you can copystr

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

Ramesh Kumar – Community Spotlight

We are honored to recognize Ramesh Kumar as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
Sohail Ahmed Profile Picture

Sohail Ahmed 2,655

#2
Mansi Soni Profile Picture

Mansi Soni 1,574

#3
YUN ZHU Profile Picture

YUN ZHU 1,453 Super User 2025 Season 1

Featured topics

Product updates

Dynamics 365 release plans