How to remove special character in column name

Hi Team,

I want to remove if special character found in column name should remove.

Please help me anyone for this.

Input:

image

Expected output:
image

Reagrds,
Raja G

Hi @Raja.G

For Each col As DataColumn In dt.Columns
    col.ColumnName = System.Text.RegularExpressions.Regex.Replace(col.ColumnName, "[^a-zA-Z0-9]", "")
Next

Input:

image

Output:

image

Regards,

1 Like

Hi @Raja.G

col.ColumnName=System.Text.RegularExpressions.Regex.Replace(col.ColumnName, "[^a-zA-Z0-9]", "")

Input
image
Output
image

1 Like