forum

Home / DeveloperSection / Forums / Split string by # and store result in a datatable

Split string by # and store result in a datatable

Jayden Bell214114-Nov-2014

I have this string:

1#3.doc#0.036/n

2#1.doc#0.026/n

I want to split it on # and put every line in a single row inside DataTable like this:

1    3.doc  0.036

2    1.doc  0.026

I have a DataTable like this:

DataTable table = new DataTable();

table.Columns.Add("Id", typeof(int));

table.Columns.Add("FileName", typeof(string));

table.Columns.Add("Content", typeof(string));

How can I do that?


Updated on 14-Nov-2014

Can you answer this question?


Answer

1 Answers

Liked By