当涉及到纯英语字符串时,我想StringComparison.OrdinalIgnoreCase
并做了同样的工作。StringComparison.InvariantCultureIgnoreCase
但是,我正在处理的以下代码并非如此:
// Returns 0
string.Compare("877495169FA05B9D8639A0EBC42022338F7D2324","877495169fa05b9d8639a0ebc42022338f7d2324", StringComparison.InvariantCultureIgnoreCase)
// Returns -1
string.Compare("877495169FA05B9D8639A0EBC42022338F7D2324","877495169fa05b9d8639a0ebc42022338f7d2324", StringComparison.OrdinalIgnoreCase)
有什么特别的原因吗?