simple console application with about 10 rows

  • Thread starter Thread starter Tony Johansson
  • Start date Start date
T

Tony Johansson

Hi!

I wonder when I pass CultureInfo.InvariantCulture as an argument to the
c-tor of new CaseInsensitiveComparer below
what effect does it have on my program. It must have some purpose
So I mean alternatives 1 and 2 below can't mean the same thing

public static void Main()
{
1 ListDictionary myList = new ListDictionary(new
CaseInsensitiveComparer(CultureInfo.InvariantCulture));
2 ListDictionary myList = new ListDictionary(new
CaseInsensitiveComparer());

myList["Estados Unidos"] = "United states";
myList["Canada"] = "Canada";
myList["Espana"] = "Spain";

Console.WriteLine(myList["espana"]);
Console.WriteLine(myList["CANADA"]);
}

//Tony
 
Tony said:
Hi!

I wonder when I pass CultureInfo.InvariantCulture as an argument to the
c-tor of new CaseInsensitiveComparer below
what effect does it have on my program. It must have some purpose
So I mean alternatives 1 and 2 below can't mean the same thing

They _can_ mean the same thing, but in your example, they don't.

It seems to me that the documentation is very clear about the difference
between the two constructors:
http://msdn.microsoft.com/en-us/lib...ensitivecomparer.caseinsensitivecomparer.aspx

What about that are you having trouble understanding?

Pete
 
Back
Top