Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I use SreamWriter and WriteLine to write to a text-file. But StreamWriter adds an extra carriage return to the end of the file. I tried Write instead of WriteLine but it didn't help.

 

:confused: How can I get rid of the extra carriage return in the end of the file?

 

:cool: I'm using VB.NET 2003

Posted

I think I have located the problem. :D It seems like it depends on the file I'm writing to. For example if I have an existing file with an extra carriage return in the end, like this:

 

"Aaaaa

Bbbbb

Ccccc

"

 

...then I try to write over it a text like this(no carriage return in the end):

 

"Aaaaa

Bbbbb

Ccccc"

 

...and like magic it doesn't replace the old text file. :eek: Seems really odd to me!!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...