I have the following code:
string myTest = "Line1Test" + Environment.NewLine +
"Line2Test" + Environment.NewLine +
"Line3Test" + Environment.NewLine;
string[] parseStr = myTest.Split(Environment.NewLine.ToCharArray());
What I'm getting is data every other line in the new array. I think this is because the split line is splitting for both line feeds and carriage returns, but how can I just get one element per line?
string[] parseStr = myTest.Split(
new string[] { Environment.NewLine },
StringSplitOptions.None
);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With