I have a datatable with column header names which has leading and trailing whitespaces. I want to remove them but not the ones in the middle.
For eg: " Column 1 " to “Column 1”
Can you provide me complete syntax
Suppose the string is stored in a variable called StringText then
StringText.TrimStart.TrimEnd should work.
I need to trim the datatable columnnames
Please can you add a screenshot of the sequence. The approach should be similar but just wanted to check if that is what is needed.
outDataTable.Columns(0).ColumnName.TrimStart()
lets assume you have a datable in place with the columnnames having the beginning ending spaces.
so with a for each you can do name correction as following
Statement:
item.Columnname = itemColumnname.trim()
Dont forget to configure the typeargument of the for each to the datatype Datacolumn
Thank you so much
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.