473,406 Members | 2,312 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Newlines don't appear in STREAMWRITER


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?

*** Sent via Developersdex http://www.developersdex.com ***
Nov 26 '05 #1
2 1389
Dear Larry,

Try setting the NewLine property to your line terminator string. See
http://msdn.microsoft.com/library/de...wlinetopic.asp
for more info.

Hope it helps,

Michel van den Berg

"Larry" <do********@nospamhere.com> schreef in bericht
news:uN*************@TK2MSFTNGP15.phx.gbl...

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?

*** Sent via Developersdex http://www.developersdex.com ***

Nov 29 '05 #2
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.
*** Sent via Developersdex http://www.developersdex.com ***
Nov 29 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Christopher Finke | last post by:
I have a site wherein the clients can update the individual pages by editing the text of that page in a <textarea>. Then, when the page is displayed, all of the newlines (\n) are converted to HTML...
4
by: Grant Edwards | last post by:
I'm using xml.sax to parse the "datebook" xml file generated by QTopiaDesktop. When I look at the xml file, some of the attribute strings have newlines in them (as they are supposed to). ...
5
by: Patrick Sannes | last post by:
Hi, At this moment I have one large sourcecode file and want to seperate it into multiple files. When I do so, the app crash after he created 6389 (156794880 bytes total) source files with the...
1
by: chrismichaelgardner | last post by:
I have a very simple Datagrid with one bound field. The field has Environment.NewLines in it. When the datagrid is rendered, they don't appear. I have tried a few of different ways to get them...
0
by: Larry | last post by:
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...
1
by: dbee | last post by:
Hi, So I'm having a problem with disappearing newlines. I import the newlines from a file into my shell script fine. But then I process the text and the url_encode comes out the other end with...
2
by: Edward K. Ream | last post by:
Hello all, I recently ran across a situation in which sax.saxutils.quoteattr did not work as I expected. I am writing Leo outlines as opml files http://en.wikipedia.org/wiki/OPML which forces...
2
by: Fred Dag | last post by:
Hi, When writing using both these methods ( StreamWriter.Write("\n") vs WriteLine() ) to a file and open in Notepad I see a special character instead of newlines with Write("\n") vs a newline...
5
by: lister | last post by:
Hi, I am trying to output a newline, but this doesn't work: echo "Line1\nLine2"; Before anyone says, I know HTML doesn't recognise newlines. I don't need newlines in the rendered HTML, I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.