views:

78

answers:

2

how do I loop through, line by line, the contexts from a textarea in asp.net?

streamreader and stream both don't accept a string.

+3  A: 

You would need to split the text in the TextBox control into lines yourself:

var textLines = myTextbox.Text.Split('\n');
foreach( var line in textLines )
   // your code...
LBushkin
+1 - This is what I want thinking, but it seemed like some trick question to me so I just put it in a comment.
tster
A: 

you need to split the TextBox Text into your array and loop through it

txtArea.Text.Split('\n');

in .Net 3.5 or above

 var s = txtArea.Text.Split('\n');

 Array.ForEach(s, r => YourLoop(r));
anishmarokey