* "Bill Rowell" <bi***@donotspam.com> scripsit:
This question is driving me nuts because I'm sure its easy to do...
If I have a text box control and a user enters some text with new line
characters in it, how could I turn around and parse that in VB?
I've tried using "\n", "\r\n", etc. and nothing seems to work. Now, I've
been trying to detect it using IndexOf, perhaps thats my problem?
Use 'ControlChars.NewLine', 'Environment.NewLine', or 'vbNewLine':
\\\
Me.Label1.Text = _
"Hello" & ControlChars.NewLine & _
"World"
///
Notice that this won't reduce performance, because the compiler detects
that the whole text on the right side of the assignment is a single
constant and stores it as one constant in the binary image. At runtime,
no concatenations are performed.
--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
<URL:http://dotnet.mvps.org/dotnet/faqs/>