Well in that case you can add your own extension method to your datarow class.
Pass datarow, loop through all datarow fields, write code to remove white spaces.
You can create a separate folder called as Fliters and add class DataRowFilter in which you write a method RemoveWhiteSpaces()
Code After such implementation will look like:
DataRow row;
row = tableName.NewRow();
row["greeting"] = "Hello World ";
row["text"] = "How are you? ";
row.RemoveWhiteSpaces();
tableName.Rows.Add(row);
Extension method article link:
Extension Methods C#
Advantage:
1) Data filteration method.
2) Whenever DataRow will be created in your dll, you can use this method.