I have a list of 24 digit strings that have been written to a textfile using the streamwriter function and I now want display each string split under a series of columns. At the moment I can display the list of strings in a rich textbox using the following code:
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim line, alltext As String
Dim sr As StreamReader = New StreamReader ("c:\report.txt")
Do
line = sr.ReadLine()
alltext = alltext & line & vbCrLf
textReport.Text = alltext
Loop Until line Is Nothing
sr.Close()
End Sub
End Class
How can I use substring to, for example, list the first 5 digits under the column 'Ref No', the sixth digit under the column 'Type' and so on?
The MSDN help is proving confusing. Can anyone help?
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim line, alltext As String
Dim sr As StreamReader = New StreamReader ("c:\report.txt")
Do
line = sr.ReadLine()
alltext = alltext & line & vbCrLf
textReport.Text = alltext
Loop Until line Is Nothing
sr.Close()
End Sub
End Class
How can I use substring to, for example, list the first 5 digits under the column 'Ref No', the sixth digit under the column 'Type' and so on?
The MSDN help is proving confusing. Can anyone help?