2011-03-16 34 views
0
Dim strTest(recordSet.Count)() As String 

While index < recordSet.Count 
    strTest(index)(recordset.item(index).getvalue(0).tostring, 
        recordset.item(index).getvalue(0).tostring, 
        recordset.item(index).getvalue(0).tostring) 
    index +=1 
End While 

然后,一旦我上面填充阵列,我需要找到如果另一个变量被包含在第二括号的第二维包含值我的变量是这样的。C#:VB.NET:如何从这个锯齿状字符串数组提取值

if strTest.Contains(someVariable) then 
    extract the index and get the other two values in the array 
end if 

所以基本上是如何执行第二个代码块在这里。

回答

1
For Each set As String() in strtest 
    If set(1).Equals(someVariable) Then 
    'Get set(0) and set(2) 
    End If 
Next 

循环遍历数组,拉动项目作为数组并检查中间项目。我想这就是你的问题所在。

0

也许你可以使用strTest.IndexOf()?

相关问题