从公布的源代码文件中可以发现在.NET中String类型的==和Equals完全一样,实现如下
/// <include file='doc\String.uex' path='docs/doc[@for="String.operatorEQ"]/*' />
        public static bool operator == (String a, String b) {
           return String.Equals(a, b);
        }
所以实际上==这个运算符重载直接用了Equals函数。

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-10-14
  • 2022-12-23
  • 2022-12-23
  • 2022-02-14
  • 2021-12-28
猜你喜欢
  • 2021-06-18
  • 2021-10-05
  • 2022-12-23
  • 2021-05-12
  • 2022-12-23
  • 2021-07-27
相关资源
相似解决方案