hey guys,
I am using windows textbox (CLR) and i was wondering how i would replace a newline to a text.
I know how to replace words, i use : textBox1->Text->Replace("first","second"));
but how would i replace a new line?


lets say my textbox looks like this :

test1

test2

what i want to then do is to replace the newlines with text(lets say 5), so after i replace it it should look like this :

test15test2

i hope i explained what i want clearly,
thanks in advanced.

You will probably have to rewrite all the text lines. Read the lines of the text box into an array of Strings, format the Strings the way you want them, then write the Strings back to the text box.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.