Last active
August 29, 2015 14:27
-
-
Save airbreather/237c93c82f43b4018fbc to your computer and use it in GitHub Desktop.
Crazy Case Comparisons
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Globalization; | |
using System.Threading; | |
namespace ConsoleApplication1 | |
{ | |
internal static class Program | |
{ | |
private static void Main() | |
{ | |
const string FirstString = "\u00e9\u0131\u0065\u0308\u0130\u004f\u0304\u0328"; | |
const string SecondString = "\u0045\u0301\u0049\u00eb\u0069\u01ed"; | |
Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo("tr-TR"); | |
// true | |
Console.WriteLine(String.Equals(FirstString, SecondString, StringComparison.CurrentCultureIgnoreCase)); | |
// false | |
Console.WriteLine(String.Equals(FirstString, SecondString, StringComparison.CurrentCulture)); | |
// false | |
Console.WriteLine(String.Equals(FirstString, SecondString, StringComparison.InvariantCultureIgnoreCase)); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment