So I am trying to read through a file and I have index set as a counter so I can move from character to character in the file to find the index where the °s are at. I keep getting IndexOutOfRangeException even though I have no clue what is wrong.
Dim chr As String
Dim c1 As String
Dim c2 As String
Dim c3 As String
Static index As Integer = -1
index += 1
chr = numDat(index)
While Asc(chr) <> 176
index += 1
chr = numDat(index)
End While
I am getting the error at the index in chr = numDat(index). Any help will be appreciated, thanks!
Edit: I forgot to mention that numDat is a string that has read in the whole file already.
numDat = My.Computer.FileSystem.ReadAllText(path + fileName)