0
这里是我的代码:VB.NET的indexOf没有找到字符串()
Dim list As New List(Of String)
'populate list with string values
Dim list2 As New List(Of String())
For i As Integer = 0 To list.Count - 1
list2.Add({list.Item(i), "temp"})
Next
for x as integer = 0 to list.count
Dim test1 = list2.indexof({list.item(x), "temp"}) '***this line is returning -1
next
虽然我可以清楚地看到列表2在它的第一个索引包含字符串:
“加里”和“温度”
拒不退回的指数以外-1,当我搜索包含索引:
{ “加里”, “TEMP”}