Delete first line of textbox

B

Boki

Hi All,

My textbox is a queue stack, after processing a line, I need to
process next line, and the first line should be removed to indicate
progress.

Should we check the new line by ourself ? and then use substring to
make a new string ?

Thanks!


Best regards,
Boki.
 
R

Roman Stehrenberger

Hi Boki

use the Lines array property of the textbox, this is an array of all lines
in a multiline textbox. After processing the first line, do the following

mytextbox.Text =
mytextbox.Text.SubString(mytextbox.lines[0].Length+Environment.Newline.Length);

this should remove the first line.

Regards

Roman
 
B

Boki

Hi Boki

use the Lines array property of the textbox, this is an array of all lines
in a multiline textbox. After processing the first line, do the following

mytextbox.Text =
mytextbox.Text.SubString(mytextbox.lines[0].Length+Environment.Newline.Length);

this should remove the first line.

Regards

Roman

Boki said:
My textbox is a queue stack, after processing a line, I need to
process next line, and the first line should be removed to indicate
progress.
Should we check the new line by ourself ? and then use substring to
make a new string ?

Best regards,
Boki.

Got it, thanks ! :)

Boki.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top