[Mono-devel-list] Patch idea for previous message
Atsushi Eno
atsushi at ximian.com
Tue Jun 7 04:03:41 EDT 2005
Yeah, I knew. However what I meant is
String.CompareOrdinal (
s1.ToLower (invariantCulture),
s2.ToLower (invariantCulture))
It is not good for performance but safe.
Atsushi Eno
Konstantin Triger wrote:
> Hi Eno,
>
> The CompareOrdinal does not have a case insensitive overload. So you
> cannot use it instead of string.Compare(s1,s2,true).
>
> Regards,
> Konstantin Triger
>
>
>
> Atsushi Eno wrote:
>
>> Hi,
>>
>> This is offtopic (I've replied for the main story yet), but
>>
>> > + if (string.Compare(attribute, value, true) == 0)
>> > + return;
>>
>> 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.
>>
>> We don't use collation now but it will be supported in the
>> near future (I hope ;-)
>>
>> Maybe I need to audit those culture-sensitive things on all
>> the libraries, including sys.xml (I once did in response
>> to Jackson's advisory but I think we need further check).
>>
>> Atsushi Eno
>>
>> _______________________________________________
>> Mono-devel-list mailing list
>> Mono-devel-list at lists.ximian.com
>> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
>
More information about the Mono-devel-list
mailing list