How to trim values in a column in a datatable


I have a datatable with few columns, I want to trim the values in a particular column.

I want to keep only the first 4 characters of a column.

Please let me know how to achieve this

step 1 use for each row

step 2 assign row("columnname that you want ") = row(“column that you want”).tostring.substring(0,4).tostring

1 Like

Are there whitespaces allowed in those 4 characters?

otherwise you might want to use Left(row(columnnr).toString.Trim,4) in the for each row

1 Like

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