2个回答
展开全部
如果是简单类型,可以用数组的indexof方法
Dim colXX As String() = New String() {"1", "2", "3", "4Dim colXX As String() = New String() {"1", "2", "3", "4"}
if (colXX.indexof("2") >= 0) then
return true
end if
Dim colXX As String() = New String() {"1", "2", "3", "4Dim colXX As String() = New String() {"1", "2", "3", "4"}
if (colXX.indexof("2") >= 0) then
return true
end if
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Public Class Form1
Dim array() As Integer = {1, 2, 3, 4, 5, 6, 7, 8, 9}
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If TextBox1.Text <> "" Then
Dim i As Integer
Dim finded As Boolean = False
For i = 0 To array.Length - 1
If array(i).ToString = Trim(TextBox1.Text) Then
Label1.Text = "找到了!位置是:" & i
finded = True
End If
Next
If finded = False Then Label1.Text = "没找到!"
End If
End Sub
End Class
Dim array() As Integer = {1, 2, 3, 4, 5, 6, 7, 8, 9}
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If TextBox1.Text <> "" Then
Dim i As Integer
Dim finded As Boolean = False
For i = 0 To array.Length - 1
If array(i).ToString = Trim(TextBox1.Text) Then
Label1.Text = "找到了!位置是:" & i
finded = True
End If
Next
If finded = False Then Label1.Text = "没找到!"
End If
End Sub
End Class
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询