Reading Lines

How would you read lines from a textbox?
[40 byte] By [WastingBody] at [2007-12-24]
# 1

The textbox has a Lines property that returns an array of strings, each string corresponding to the current line...

For Each str As String In TextBox1.Lines
' Do whatever you want with the line...
End If

Best regards,
Johan Stenberg

MSJohanStenberg at 2007-8-31 > top of Msdn Tech,Visual Basic,Visual Basic Language...
# 2

Lines is an array - to you can reference the specific line you want rath than simply iterating through it.

Textbox.Lines property
http://msdn2.microsoft.com/en-us/library/system.windows.forms.textboxbase.lines.aspx

Example

Dim tempArray() as String
tempArray = textBox1.Lines

Dim s as string = temparray(0) '//Will show first line contents
s = temparray(1) '//Will show second line contents

spotty at 2007-8-31 > top of Msdn Tech,Visual Basic,Visual Basic Language...