Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Globalization;
- using System.Threading;
- class Program
- {
- static void Main()
- {
- Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
- Console.WriteLine("id".Equals("ID", StringComparison.CurrentCultureIgnoreCase)); // True
- Thread.CurrentThread.CurrentCulture = new CultureInfo("tr-TR");
- Console.WriteLine("id".Equals("ID", StringComparison.CurrentCultureIgnoreCase)); // False <- bug
- Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
- Console.WriteLine("id".Equals("ID", StringComparison.OrdinalIgnoreCase)); // True
- Thread.CurrentThread.CurrentCulture = new CultureInfo("tr-TR");
- Console.WriteLine("id".Equals("ID", StringComparison.OrdinalIgnoreCase)); // True
- }
- }
Add Comment
Please, Sign In to add comment