aueddonline
Technical User
I have this code that takes the the text from a multiline textbox line by line, I then have another textbox, when I try to concatenate these together in a message box the first massage box displays correctly but then subsequent ones show a line break so the dirs(1) dirs(2) etc show on a newline?
Dim arrlist As ArrayList
arrlist = New ArrayList
Dim dirs() As String
Dim line As String
Dim i As Integer
Dim major As String = txtmajor.Text
dirs = TextBox1.Text.Split(vbCrLf)
Dim length As Integer = dirs.Length - 1
For Each line In dirs
line = line.Replace(vbCr, "").Replace(vbLf, "")
arrlist.Add(line)
Next
For i = 0 To length
MsgBox(major & "\" & dirs(i))
Next
Dim arrlist As ArrayList
arrlist = New ArrayList
Dim dirs() As String
Dim line As String
Dim i As Integer
Dim major As String = txtmajor.Text
dirs = TextBox1.Text.Split(vbCrLf)
Dim length As Integer = dirs.Length - 1
For Each line In dirs
line = line.Replace(vbCr, "").Replace(vbLf, "")
arrlist.Add(line)
Next
For i = 0 To length
MsgBox(major & "\" & dirs(i))
Next