I’m dealing with datatables and in the datatable there are some special characters. I want to remove those without using looping.
How do I do this?
I’m dealing with datatables and in the datatable there are some special characters. I want to remove those without using looping.
How do I do this?
Try with this linq method
yourDT = yourDT .AsEnumerable().Select(Function(row) yourDT .Clone().LoadDataRow(row.ItemArray.Select(Function(value) System.Text.RegularExpressions.Regex.Replace(value.ToString(), “[^a-zA-Z0-9]”, “”)).ToArray(), False)).CopyToDataTable()
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.