I have a split on a newline which works fine, but it seems to create a blank value for every time it does a split, so 'MyText' contains the following values, separated by a newline:
Blue
Green
Yellow
And my split is as below
List<string> options = myText.split('[\r\n]');
I instead of ending up with 3 'options' I end up with 5 like this - a blank for each newline:
Blue,'',Green,'',Yellow
Other than ignoring the blank values in a loop, how can I avoid the split creating the blanks in the first place?