I currently have a DataSet which contains a single table.
Inside the single table there are 150,000 rows. Each row contains 15 columns.
What I need to do is trim the whitespace from all fields before and after (I would assume using String.Trim()
)
I have the following foreach loops which pull the data as required, however I'm unable to overwrite the values in the DataSet itself:
foreach (DataTable table in MyData.Tables)
{
foreach (DataRow row in table.Rows)
{
foreach (object item in row.ItemArray)
{
// Trim Whitespace Here
}
}
}
Also, for one particular column I need to remove all whitespace (including the spaces in a string itself). Can this be done for a particular column using the above foreach
?