Convert 1d array to a single string

Hi,
i need to convert the below string to a specific pattern like this “11,979”,“165”,“12,144”,“599”,“0”,“0”,“12,743”

string[8]
{
“11,979”,
“165”,
“12,144”,
“599”,
“0”,
“0”,
“12,743”,
“”
}

Use split function to separate the no, use a for loop to assign the values to string array.

to convert Array to string,

" String.join(array_variable,“Separator”)"
ex:
String.join({“2”,“3”,“4”},",")
Output: “2,3,4”

Reference: https://www.dotnetperls.com/string-join

2 Likes

Hi,

There is a slight change in the syntax.
It’s "String.join(“Separator”,array_variable)" :slightly_smiling_face:

Warm regards,
Nimin

4 Likes

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