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」}