[Mono-devel-list] Patch idea for previous message

Kornél Pál kornelpal at hotmail.com
Tue Jun 7 03:50:07 EDT 2005


> From: Konstantin Triger
> The CompareOrdinal does not have a case insensitive overload. So you
> cannot use it instead of string.Compare(s1,s2,true).

> From: Atsushi Eno
>> you'd like to be careful to use String.Compare() since it is
>> culture-sensitive comparison by default. In that case,
>> CompareOrdinal() leads you to the right way.

Any method that is culture-sensitive can take CultureInfo.InvariantCulture
as a formatter, comparer, ..., at this will make it culture-insensitive as
InvariantCulture should have the same characterisitcs across all versions
and even in different runtimes.

Use string.Compare(s1,s2,true,CultureInfo.InvariantCulture) for example.

Kornél




More information about the Mono-devel-list mailing list