Id like to remove all the special characters other than digits from the Phone No. column. I know this can be achieved using a For Each, but I wanted to know whether it was possible using LINQ.
ALSO
The columns are dynamic i.e, we might not always know what all columns might be added, as I am joining several tables together.
Help would be most appreciated, thanks in advance!
Just use a For Each. This obsession around here with avoiding For Each is pointless. It’s not a performance issue. LINQ loops anyway, it’s just hidden to you.
in case of only a few columns are to update go for a for each
we can do it with a regex.replace(YourString, "\D", "")
In case of the column name / index is unclear we can iterate over the ItemArray and check if its needed (also can exclude columns within the same time)