I want to remove spaces from a DataTable without using a loop. Can anyone help with that?
Example:
- Input: [33,11.1 2]
- Output: [33,11.12]
Thanks in advance!
I want to remove spaces from a DataTable without using a loop. Can anyone help with that?
Example:
Thanks in advance!
Hi @madhabhazra0,
try with this LINQ:
dt.AsEnumerable().Select(Function(row) dt.Clone.LoadDataRow(row.ItemArray.Select(Function(field) field.ToString().Replace(" ", "")).ToArray(), False)).CopyToDataTable()
Thanks
Use invoke code like shown below :
dt.AsEnumerable.ToList().ForEach(Sub(r)
r(“col1”)=r(“col1”).ToString.Replace(" “,”")
End Sub
)

Thanks for your help @Manisha_Ravindra
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.