Skip to main content

Notifications

Announcements

No record found.

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 22

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, 

  • Sergei Minozhenko Profile Picture
    23,091 on at
    RE: hfunction in Visual Studio to separate string

    Hi @rp@n,

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

  • @rp@n Profile Picture
    22 on at
    RE: hfunction in Visual Studio to separate string

    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,091 on at
    RE: hfunction in Visual Studio to separate string

    Hi @rp@n,

    It's correct.

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

  • @rp@n Profile Picture
    22 on at
    RE: hfunction in Visual Studio to separate string

    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,091 on at
    RE: hfunction in Visual Studio to separate string

    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
    22 on at
    RE: hfunction in Visual Studio to separate string

    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

  • Suggested answer
    Sergei Minozhenko Profile Picture
    23,091 on at
    RE: hfunction in Visual Studio to separate string

    Hi @rp@n,

    There is 'Split' function available in SSRS expressions.

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

    pastedimage1596804718840v1.png

  • Suggested answer
    nmaenpaa Profile Picture
    101,158 Moderator on at
    RE: hfunction in Visual Studio to separate string

    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 "-"

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,261 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 233,013 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Product updates

Dynamics 365 release plans