开发者

How to check if a List A is a sub-list in List B using VB.net?

开发者 https://www.devze.com 2023-03-22 18:19 出处:网络
Do I have to write my own Function ? Is there a built in Function 开发者_高级运维in List to checks another list for membership ?Dim ListA As New List(Of Int32)(New Int32() {1, 3, 5})

Do I have to write my own Function ?

Is there a built in Function 开发者_高级运维in List to checks another list for membership ?


Dim ListA As New List(Of Int32)(New Int32() {1, 3, 5})
Dim ListB As New List(Of Int32)(New Int32() {1, 2, 4, 6, 5, 3, 7})
Dim isSubList = Not ListA.Except(ListB).Any() 'True'

MSDN: Enumerable.Except

0

精彩评论

暂无评论...
验证码 换一张
取 消