Voici une méthode simple pour convertir une String en "Lower ACSII" (ASCII 127 caractères, donc sans nos accents).
VBPublic Function ToLowerASCII(ByVal s As String) As String Return New String( _ s.Normalize(System.Text.NormalizationForm.FormD).ToCharArray() _ .Where(Function(c As Char) System.Globalization.CharUnicodeInfo.GetUnicodeCategory(c) <> System.Globalization.UnicodeCategory.NonSpacingMark) _ .ToArray()) End Function
C#
public String ToLowerASCII(String s) { return new String( s.Normalize(NormalizationForm.FormD).ToCharArray() .Where(c => System.Globalization.CharUnicodeInfo.GetUnicodeCategory(c) != System.Globalization.UnicodeCategory.NonSpacingMark) .ToArray()); }