How to split a multi-line string in string array in vb.net using Delimeter?

Viewed 1116

I have utility in VB language. That splits the string. User provide string(may be multiline string) and delimiter. And output will be string array. What will be the input delimiter to split string from new Line?.

Currently I am using Dim output = Split(InputString, delimiter) to split string.

In VB code there is option Environment.NewLine.

But end user know only "\n" for new line.

So my question is What will be the input delimiter to split string from new Line?

1 Answers

Probably vbCrLf, vbLf or vbCr, depending on what is in your string.

If they are typing the text in a TextBox or saving it in a file, vbCrLf should split your string into individual lines.

Related