Re: \n in C#?
- From: "Scott Coonce" <sdcoonce@xxxxxxxxxxxxxxxxx>
- Date: Sun, 16 Oct 2005 09:48:33 +0200
Mmm Jon,
Pardon my confusion, but was interested in such a long thread about such a
simple topic (at first glance). Reflector gives the following code:
public static string get_NewLine()
{
return "\r\n";
}
Isn't this the compiler hard coding the newline string?
Scott
"Jon Skeet [C# MVP]" <skeet@xxxxxxxxx> wrote in message
news:MPG.1dbbfcd1b10cf47298c90b@xxxxxxxxxxxxxxxxxxxxxxx
> Michael A. Covington <look@xxxxxxxxxxxxxxxxxxxxxx> wrote:
>> This is the kind of thing that ought to be built into the language as
>> something more concise than Environment.NewLine. Maybe define \N as the
>> OS-dependent newline, known to the compiler.
>
> No - precisely because it's *not* known to the compiler. The compiler
> doesn't know what platform the code is going to *run* on, it only knows
> the platform it's being *compiled* on.
>
> --
> Jon Skeet - <skeet@xxxxxxxxx>
> http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
> If replying to the group, please do not mail me too
.
- Follow-Ups:
- Re: \n in C#?
- From: Jon Skeet [C# MVP]
- Re: \n in C#?
- References:
- Re: \n in C#?
- From: JS
- Re: \n in C#?
- From: Michael A. Covington
- Re: \n in C#?
- From: Jon Skeet [C# MVP]
- Re: \n in C#?
- Prev by Date: how does this still work??
- Next by Date: Re: \n in C#?
- Previous by thread: Re: \n in C#?
- Next by thread: Re: \n in C#?
- Index(es):
Relevant Pages
|