How to combine array of string and separate them with coma

Hello

I have requirement where I have an array ,let’s say MyArr () = { “Sam”, “Lenny”, “Ram”}

I want to print these in 1 line separated by commas i.e.

Output : Sam,Lenny,Ram

I do not want to use for each loop and append one by one to string. Any idea?

Hi @Sumit_Shetty

Use the expression Below

String.Join(",",Yourarrayvariable)

Regards

2 Likes

Hello welcome to forum @Sumit_Shetty

Try this
String.join(“,”,myArr),

Regards,

1 Like

Thank you, this worked

Thank you for replying, this worked too

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