some of your questions are answered here:
http://msdn2.microsoft.com/en-us/library/b873y76a.aspx
Normally, no exceptions, see the doc for return values in various
situations.
If it's delimited by '\n' characters you'll need to use \n with single
quotes around the \n: '\n'.
Yes, with the [0] at the end you'll get the first line, but you'll probably
get exceptions if you're not careful about the text that you're reading in.
Mike
http://www.seeknsnatch.com
"Mark Rae" <ma**@markNOSPAMrae.comwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
"Daniel" <fj*******************@hotmail.comwrote in message
news:44*********************@dreader1.cybercity.dk ...
>I would like to remove everything else but one line of text in a String.
I have tried using .Split("\n"), however I did not succeed.
The string contains three lines, but I only need the string to contain
the first line.
How do you know that Split didn't work...? Did you get any error messages?
What was the length of the array created by Split?
If your string is delimited by \n, then <stringVariable>.Split("\n")[0]
should give you the first line only...