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 :
Finance | Project Operations, Human Resources, ...
Suggested Answer

hfunction in Visual Studio to separate string

(0) ShareShare
ReportReport
Posted on by 56

hi all,

i have string like

value   = "1222502-00000023-001-001";

is there any function in Visual Studio to separate string in below format ??

a = 00000023;
b = 001;
c = 001;

i have required this function for SSRS report

please give me more shed on this, 

I have the same question (0)
  • Suggested answer
    nmaenpaa Profile Picture
    101,172 Moderator on at

    You can use the x++ string functions to achieve that: docs.microsoft.com/.../xpp-string-run-time-functions

    You can use strFind to find a specific character from a string (or from part of a string).

    And you can use subStr to copy a part of a string to another string.

    You need three pieces of code:

    a: All characters after the first "-" and before the second "-"

    b: All characters after the second "-" and before the third "-"

    c: All characters after the third "-"

  • Suggested answer
    Sergei Minozhenko Profile Picture
    23,095 on at

    Hi @rp@n,

    There is 'Split' function available in SSRS expressions.

    stackoverflow.com/.../ssrs-expression-to-split-string-possible

    pastedimage1596804718840v1.png

  • @rp@n Profile Picture
    56 on at

    Sergei,

    i have to display in 3 columns the values in below format

    a = 00000023;

    b = 001;

    c = 001

    i have used

    split(Fields!Dimension.Value,"-"),

    but in report it's showing [tag:Error]

    1261.report.jpg

  • Sergei Minozhenko Profile Picture
    23,095 on at

    Hi @rp@n,

    Have you checked StackOverflow article with examples?

    =Split(Fields!Dimension.Value, "-").GetValue(0) //First value

    =Split(Fields!Dimension.Value, "-").GetValue(1) //Second

    =Split(Fields!Dimension.Value, "-").GetValue(2)

  • @rp@n Profile Picture
    56 on at

    hi Sergei,

    it's work for me

    =Split(Fields!Dimension.Value, "-").GetValue(1) //First value

    =Split(Fields!Dimension.Value, "-").GetValue(2) //Second

    =Split(Fields!Dimension.Value, "-").GetValue(3)

    means here the

    value   = "1222502-00000023-001-001";

    1222502 = 0

    00000023 = 1

    001 = 2

    001 = 3

    So, based on the above expression it's pick the value 1 position value after "-" i.e 00000023  

    rite?

  • Sergei Minozhenko Profile Picture
    23,095 on at

    Hi @rp@n,

    It's correct.

    Split "Returns a zero-based, one-dimensional array containing a specified number of substrings."

  • @rp@n Profile Picture
    56 on at

    is it possible to remove the values from the column which coming as concatenate. because we already spitted values  in 3 columns

  • Sergei Minozhenko Profile Picture
    23,095 on at

    Hi @rp@n,

    Probably you can just put empty expression for the column or remove it completely.

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 657

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 615 Super User 2026 Season 1

#3
CP04-islander Profile Picture

CP04-islander 356

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans