t 返回-1 证明2个字符串不等;
string.Compare 
比较两个指定的 string 对象。

解决方案 »

  1.   

    默认情况下,String.Compare 方法执行区分区域性的比较和区分大小写的比较。但是,提供了 String.Compare 方法的重载,它允许您通过提供 culture 参数来指定要使用的区域性。应用程序代码应该清楚地说明字符串比较是区分区域性的,还是不区分区域性的。对于区分区域性的操作,请指定 CultureInfo.CurrentCulture 属性作为 culture 参数。int compareResult = String.Compare(string1, string2, false, CultureInfo.InvariantCulture);
      

  2.   

    还有,在char类型的值在比较时才会转换为int(ASKII码值),字符串时不会这样的 ;
      

  3.   

    请进一步解释一下,A为什么大于a,或者说A的什么值大于a,这才是我想问的关键