index was outside the bounds of the array because of \n (new line) in richTextBox

Posted by revvs on Stack Overflow See other posts from Stack Overflow or by revvs
Published on 2011-01-06T02:30:44Z Indexed on 2011/01/06 2:53 UTC
Read the original article Hit count: 157

Filed under:

If i go into the next line with richTextBox1.Text + "\n" you can't use richTextBox with anything anymore normally. Why not ? because index will be outside the bounds of the array and you won't be able to transport the data into database or work with it normally...it will be all messed up. It is like the story with cin and getline in C++, but much worse. Here you won't see errors, not until you'll try to transport it into database. If you use "\n" to write new lines into txt, your txt will be also unusable. It will look like up to the byte the same as if you would write it by hand same sentences but "\n" will fuck it up.

So how do i go into the next line and not have this "\n" screwing up my program ??! How do i go into the new line ?

© Stack Overflow or respective owner

Related posts about c#