如何验证列表是否包含 vb 脚本中的特定字符串?

时间:2021-02-08 04:55:53

标签: string list contains qtp

我有一个值列表 list1 和另一个包含 list1 值的 list2。我想验证 list1 的内容是否存在于 list2 中?任何人都可以帮助我用任何特定的方法来验证这一点吗? 我不想使用基本的循环方法,因为它会花费很多时间来执行。 我试过下面的代码,但没有用:

代码:

      Set headerInfo = CreateObject.("System.Collections.ArrayList")
      //...add few values in list..
      Set generalInfo = CreateObject.("System.Collections.ArrayList")
      //...add values including the one which are present in above list...
    
    For i=0 to headerInfo.Count-1 step 1
      If Ubound(Filter(generalInfo,headerInfo(i))) Then
       print "string present"
      EndIf
   Next

0 个答案:

没有答案
相关问题