simple console application with about 10 rows

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
 
P

Peter Duniho

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top