Convert data column to string with ";" as seporator

Hello guys, i have a data table with one column in it. There is data in the column rows - numbers and sometimes text ( the data one time could be less, could be more. Its not always the same data). Is it possible, to convert this data table to a string, with symbol β€˜;’ as a seperator between values? For example, the data table now looks like this:
image
I need it to convert to a string looking like this: N/A;3;4;5;6;7;8;10;11;12;13;15;16;17

Thanks for the help :slight_smile:

Hi @Povilas_Jonikas

Try this:
Assign activity:
ResultString = String.Join(";", YourDataTable.AsEnumerable().Select(Function(row) row.Field(Of String)("ColumnName")).ToArray())
or
ResultString = String.Join(";", yourDataTable.AsEnumerable().Select(Function(row) row(0).ToString()).ToArray())

1 Like

@Povilas_Jonikas

outputstr=

string.join(β€œ;”,Dt.asenumerable.select(function(x) x(β€œxLygis”).tostring).toarray)

cheers

1 Like

Hi @Povilas_Jonikas

Please try this

String.Join(";", dt.AsEnumerable().Select(Function(row) row.Field(Of Object)("Name")))

Hope this helps!!

1 Like

Thanks guys, all the solutions are great!

1 Like

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