Remove Accents from Names in a Datatable so that they will match in a comparison

I have a process that matches up names from 2 datatables and reports matches back to a user. I came across an issue today where a match should have been found but was excluded because the name in one of the datatables contains accents.

Made up example:
Gülçin Ekmekçi

Gulcin Ekmekci

Is there a way that I can get these names to match, maybe ignoring the accents or would i have to go through the datatable and replace them with non accented characters?

I have tried a for each loop using the solution on this FORUM POST but i think this would be slow running over a whole datatable and also i could not make it work.

Is there a way that I can replace all accented characters in a datatable without impacting performance too much?

Any help is much appreciated. Thanks


How about the following expression?


And we can use InvokeCode activity if there is performance issue.

    r("ColumnName") = System.Text.RegularExpressions.Regex.Replace(r("ColumnName").ToString.Normalize(System.Text.NormalizationForm.FormD),"\p{Mn}","")
End Sub


1 Like

Thank You Yoichi!!! This both solutions worked perfectly, I’ll be making use of the solution using Invoke Code so that it will remove accents from all names in the datatable. Thank for your help with this and for sharing your knowledge. Much appreciated!!

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.