Newlines don't appear in STREAMWRITER

  • Thread starter Thread starter Larry
  • Start date Start date
L

Larry

if I type in the return character in a text box or richtext box, I do
not see the newline character in a string.
Scenario - I type 2 paragraphs in a text box. Visibly I can see the
information the windows form, but if I output the text in the textbox to
a string, and write the string to a file, I do not see that formatting.
Why not?

What do I need to do?

so sMyMessage = textbox1.text


where textbox1.text contains

"Hi my name is joe.

Yes, I had a happy holliday."


when a streamwriter is created, I do not see the lines between the first
and second line in the string file. Everything appears as continuous as
"Hi my name is joe. Yes, I had a happy holliday."

this is not what I want. I need things written to the file on separate
line. How do I fix it?
 
OK,
I read the URL that you posted, but it still does not seem to help me
out.

I lose all the formatting and proper number of spaces when I store
something in a string. and then write the string to the file.
If I had 2-3 paragraphs with indents in a form control edit field. If I
put that paragraph into a string variable.
Dim sMyString as string = txtTextbox1.text

if i pass 'sMyString' to a streamwriter, i lose the formatting between
paragraphs. how can I prevent that? Is there a way to 'auto detect'
the formatting? is there any sample code to auto-detect the formatting.
 
Back
Top