Lets say I have
string str = @"Line 1
Line 2
Line 3";
How can I turn this into an array where the 3 elements are "Line 1", "Line 2" and "Line 3".
var strArray = str.Split(new [] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries);
\r and \n characters.\r\n combination where as before you were splitting if there was only a single \r or a single \n. This would now remove blank lines which may or may not be desirable.
String.Splitcan help you?var lines = new System.Windows.Forms.TextBox { Text = str }.Lines;