I’ve got a text box control on a page and I want people to add URLs, one on each line and then split those URLs into an array.
So, I’m trying to split them on the newline character. I’ve tried:
.split(Environment.Newline)
.split('vbcrlf')
.split(vbcrlf)
.split((char)Environment.Newline)
but all to no avail. What am I doing wrong?
This is because
Environment.Newlineis a string, so you must pass it in as an array of strings, as the function overload requires, also there needs to be aStringSplitOptionsvalue included. This can either beStringSplitOption.NoneorStringSplitOption.RemoveEmptyEntries.