16,554
社区成员
发帖
与我相关
我的任务
分享
Dim A() = {0,1,2}
Dim B() = {0,1,2}
A.Equals(B)
A Is B
Imports System.Runtime.CompilerServices
Module Module1
<Extension()>
Function EqualsWith(a As Integer(), b As Integer()) As Boolean
Return Not (From x In a Where Not b.Contains(x)).Any And Not (From x In b Where Not a.Contains(x)).Any
End Function
End Module
那么就能判断Dim A() = {0, 1, 2}
Dim B() = {0, 1, 2, 3}
Dim r = A.EqualsWith(B)
是否相等了。但是这是我的规则。
结果不重要,重要地是这里用到了什么编程知识点,为什么要自己写一个函数,这些知识才重要。