How to filter out data in a dataTable that has a newline character data

Need to be screened out comapny3, comapny5


Hi William,

You can achieve this using LINQ -

Assign: dtCorrected= yourDatatbleVar.Clone

Assing: dtCorrected =

(From r In yourDatatbleVar.AsEnumerable
Select ia = r.ItemArray.toList
Select ic = ia.ConvertAll(Function (e) e.ToString.Trim).toArray()
Select dtCorrected.Rows.Add(ic)).CopyToDataTable()

Hope this helps :slight_smile:

1 Like

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