What's the best way to read in a the contents of a textbox line by line in VB.net 2.0?
I'm currently using the one listed at TextBoxBase.Lines Property at MSDN but wanted to know what other ways could one read in a textbox line by line in VB.net.
What's the best way to read in a the contents of a textbox line by line in VB.net 2.0?
I'm currently using the one listed at TextBoxBase.Lines Property at MSDN but wanted to know what other ways could one read in a textbox line by line in VB.net.
It might not be the best way, but you could always use textbox.Text.Split(vbnewline), which will return an array of string. You could use that in a for each loop
For each strLine as string in textbox.text.split(vbnewline) ... end for
The Lines property is what you want to use. Parsing the Text property yourself requires more code and doesn't make it faster. Write a better question if you have a reason to look for an alternative.