나는 10 행의 이름 공간 마지막 이름 공간 우편 번호 배열이 있습니다. 모든 우편 번호는 다른 번호로 시작됩니다. 그 대신 아래 숫자의 # 1을 대체하여 숫자 문자를 검색 할 수 있습니까?VB.net 배열 검색에 대한 질문
'open file
inFile = IO.File.OpenText("Names.txt")
'process the loop instruct until end of file
intSubscript = 0
Do Until inFile.Peek = -1 OrElse intSubscript = strLine.Length
strLine(intSubscript) = inFile.ReadLine
intSubscript = intSubscript + 1
Loop
inFile.Close()
intSubscript = 0
strFound = "N"
Do Until strFound = "Y" OrElse intSubscript = strLine.Length
intIndex = strLine(intSubscript).IndexOf("1")
strName = strLine(intSubscript).Substring(0, intIndex - 1)
If strName = strFullname Then
strFound = "Y"
strZip = strLine(intSubscript).Substring(strLine(intSubscript).Length - 5, 5)
txtZip.Text = strZip
End If
Loop
End Sub
'strFound' 대신'Boolean'을 사용해야합니다. – SLaks