Display integer array in one line

Hi Friends,

Is there any way of displaying array of integers in one line in messagebox?

I am having,
intArray = new integer(){11,22,33,44,55,66,77,88,99}

Expected output to be displayed:
{11,22,33,44,55,66,77,88,99}

@Neal369

Try this

String.Join(",",varArray.Select(function(x) x.ToString))

Or you can use without select function as well on an integer array…tested just now

Hope this helps

Cheers

1 Like

Hi,

How about the following?

"{"+String.Join(",",intArray)+"}"

OR, simply

String.Join(",",intArray)

Regards,

1 Like

@Anil_G
Thank you for reply,

It displays as, 11,22,33,44,55,66,77,88,99
it should be, “{”+ String.Join(“,”, outputArray.Select(function(x) x.ToString)) + “}”

Many Thanks,
Nilesh

@Yoichi

Perfect, Working fine.

Thank you,
Nilesh

1 Like

@Neal369

Yes if you need brackets them they can be concatenated as its a string

Cheers

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.