I’m trying to convert this code from C# to VB.NET
string[] lines = theText.Split(new string[] { "\r\n", "\n" }, StringSplitOptions.None);
Here’s what I have, the problem is it is printing the whole of the text box contents in the messagebox, instead of each line.
Dim Excluded() As String
Dim arg() As String = {"\r\n", "\n"}
Excluded = txtExclude.Text.Split(arg, StringSplitOptions.None)
For i As Integer = 0 To Excluded.GetUpperBound(0)
MessageBox.Show("'" & Excluded(i) & "'")
Next
Escape sequences don’t really exist in VB .Net as far as string literals are concerned.
There are 2 special constants which you can use instead:
vbCrLfvbLfShould do the trick (untested though).