Formatting or Encoding a multiline textbox?
-
If a user enters data into a multiline textbox (like the one im typing in now) how can i store the line breaks? in other words, if i just use
myTextBox.Text
it is all one long runon, even if i have a few blank lines like this: i am storing this textbox, then displaying it.. i want the line breaks to exist as they did when the user entered the text.. not a long runon.. do you know what i mean? is it something simple? thanks for the tips. still a newb.. cut me some slack :P -dz -
If a user enters data into a multiline textbox (like the one im typing in now) how can i store the line breaks? in other words, if i just use
myTextBox.Text
it is all one long runon, even if i have a few blank lines like this: i am storing this textbox, then displaying it.. i want the line breaks to exist as they did when the user entered the text.. not a long runon.. do you know what i mean? is it something simple? thanks for the tips. still a newb.. cut me some slack :P -dzI have the same problem!:(
Don't forget, that's
Persian Gulf
not Arabian gulf!
-
I have the same problem!:(
Don't forget, that's
Persian Gulf
not Arabian gulf!
i figured out a way to do it.. not sure if its the right way, but it seems to work for what i need it for..
string strTemp = myTextBox.Text;
string strCorrect = strTemp.Replace("\n", "<br>");that will make it go through the text and replace all the end of line characters with <br> hope that helps! still a newb.. cut me some slack :P -dz
-
i figured out a way to do it.. not sure if its the right way, but it seems to work for what i need it for..
string strTemp = myTextBox.Text;
string strCorrect = strTemp.Replace("\n", "<br>");that will make it go through the text and replace all the end of line characters with <br> hope that helps! still a newb.. cut me some slack :P -dz
Yes, it works, no slack! ;) thank you! :):rose::)
Don't forget, that's
Persian Gulf
not Arabian gulf!