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
吧唧妳壹口
2024-11-07 02:47:17
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