-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
MonsterMMORPG
  • 21,378
  • 72
  • 196
  • 320

1 Answers1

2

This compares all those strings as equal:

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