Re: Downloading unix \n text files, convert to \r\n non-unix?
- From: "Zytan" <zytanlithium@xxxxxxxxx>
- Date: 5 Apr 2007 05:24:38 -0700
But I think:
string s = "A\nBB\nCCC";
Console.WriteLine(s.Length);
s = Regex.Replace(s, "(?<!\r)\n", Environment.NewLine);
Console.WriteLine(s.Length);
is better code !
Thanks, Arne. So, this replaces both \r and \r\n with the proper
newline. So, this should work for any string! great!
Zytan
.
- Follow-Ups:
- Re: Downloading unix \n text files, convert to \r\n non-unix?
- From: Arne Vajhøj
- Re: Downloading unix \n text files, convert to \r\n non-unix?
- From: Arne Vajhøj
- Re: Downloading unix \n text files, convert to \r\n non-unix?
- References:
- Downloading unix \n text files, convert to \r\n non-unix?
- From: Zytan
- Re: Downloading unix \n text files, convert to \r\n non-unix?
- From: Zytan
- Re: Downloading unix \n text files, convert to \r\n non-unix?
- From: Arne Vajhøj
- Re: Downloading unix \n text files, convert to \r\n non-unix?
- From: Arne Vajhøj
- Downloading unix \n text files, convert to \r\n non-unix?
- Prev by Date: Re: Downloading unix \n text files, convert to \r\n non-unix?
- Next by Date: Re: application won't start if needed assembly is missing...
- Previous by thread: Re: Downloading unix \n text files, convert to \r\n non-unix?
- Next by thread: Re: Downloading unix \n text files, convert to \r\n non-unix?
- Index(es):
Relevant Pages
|
Loading