To remove specific string from datatable

Hi All,

How to remove specific string from the datatable. It may contain in multiple columns
for eg, FGO and ADO.
These two string could be end of whole string or at the beginning or in the middle.

Thanks in advance.

You can try the following:

Assign Activity
dtCleansed | DataType: DataTable = YourOriginDataTableVar.Clone

Assign Activity
dtCleansed =

(From d in YourOriginDataTableVar.AsEnumerable
Let rac = d.ItemArray.Select(Function (x) Regex.Replace(x.ToString,"FGO|ADO","")).Cast(Of Object).toArray
Select r=dtCleansed.Rows.Add(rac)).CopyToDataTable

Ensure the following:

If further assistance is needed share with us some sample input data

1 Like

Hi @NaveenKNave

Try this,
row(col.ColumnName) = row(col.ColumnName).ToString.Replace(“FGO”, “”).Replace(“ADO”, “”)

Happy Automation