>>Actually, you're still needlessly jumping through hoops. Take a look at this:
>>
>>
>>string CRLF = "\r\n";
>>string TestString = string.Format("Test this string. {0}It contains {1}a CRLF.{2}QED", CRLF, CRLF, CRLF );
>>string[] lines = TestString.Split(CRLF.ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
>>
>>for (int i = 0; i < lines.Length; i++)
>>{
>> Debug.WriteLine(lines[i]);
>>}
>>
>Thanks, this is exactly what I was looking for.
Something odd here: In your original message as I see it there's a line that says:
"But, I would like to understand the use of .ToCharArray()." but it doesn't get reproduced in this reply ?
Anyway, FWIW, it does what is says on the box: Converts a string to an array of Char. eg:
char[] array = "This is a string".ToCharArray();
P.S to Bonnie : I hadn't clocked the StringSplitOptions enum till now :-{
P.P.S pre tags also don't work for me at the moment.