-2

Alright here 4 words which are equal at SQL server Latin1_General_100_CI_AI collation which is case insensitive and accent insensitive

taraflı
TaraFLI
TARaFLİ
Tarafli

However i could not find a way to compare these as equal at C# .net 4.5.1

Are there any way to make such comparsion like in SQL server ?

I checked this thread as well : Ignoring accented letters in string comparison

Event RemoveDiacritics method at that thread fails

Community
  • 1
  • 1
Furkan Gözükara
  • 22,964
  • 77
  • 205
  • 342

1 Answers1

2

This compares all those strings as equal:

string.Compare(s1,s2,
               CultureInfo.InvariantCulture,
               CompareOptions.IgnoreNonSpace | CompareOptions.IgnoreCase)
Mark Cidade
  • 98,437
  • 31
  • 224
  • 236
  • Example string.Compare("citroen","Citroën", CultureInfo.InvariantCulture, CompareOptions.IgnoreNonSpace | CompareOptions.IgnoreCase) 0 – Pažout Jan 31 '20 at 14:19