|
-
May 14th, 2006, 04:02 PM
#1
Thread Starter
Hyperactive Member
[RESOLVED] [2.0] New line
In notepad if I use "\r" it looks like this:
Z:\Musak\ACDC - Back In Black.mp3
Z:\Musak\ACDC - Big Balls.mp3
Z:\Musak\ACDC - Dirty Deeds Done Dirt.mp3
Z:\Musak\ACDC - Hells Bells.mp3
In wordpad:
Z:\Musak\ACDC - Back In Black.mp3 Z:\Musak\ACDC - Big Balls.mp3 Z:\Musak\ACDC - Dirty Deeds Done Dirt.mp3 Z:\Musak\ACDC - Hells Bells.mp3
\n in word pad does:
Z:\Musak\ACDC - Back In Black.mp3
Z:\Musak\ACDC - Big Balls.mp3
Z:\Musak\ACDC - Dirty Deeds Done Dirt.mp3
Z:\Musak\ACDC - Hells Bells.mp3
and in note pad it leaves like ascii char 13 or something on the end of each line. What is with this how can I make it look good in all text editors..
-
May 14th, 2006, 08:18 PM
#2
Re: [2.0] New line
The proper line break sequence for Windows text files is a carriage return followed by a line feed. The escape character for a carriage return is '\r' and the escape character for a line feed is '\n', thus the proper escape sequence for Windows text files is "\r\n". I tested that and it looked the way it should in both Notepad and WordPad. Note also that if you have a string array you could use the IO.File.WriteAllLines method and avoid line breaks and StreamWriters yourself altogether.
-
May 14th, 2006, 08:26 PM
#3
Re: [2.0] New line
You might also just grab the value of the Environment.NewLine string and use that -- it will return whatever the appropriate new line character(s) are for whatever platform your program is currently running on.
Every passing hour brings the Solar System forty-three thousand miles closer to Globular Cluster M13 in Hercules -- and still there are some misfits who insist that there is no such thing as progress.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|