【发布时间】:2017-10-19 02:19:43
【问题描述】:
这是我的代码:
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
虽然我可以清楚地看到 list2 在其第一个索引中包含字符串:
“加里”和“临时”
当我搜索包含以下内容的索引时,它拒绝返回 -1 以外的索引:
{“加里”,“临时”}
【问题讨论】: