Advertisement
ivandrofly

New line literal vs Unliteral

Jul 24th, 2015
437
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.44 KB | None | 0 0
  1. using System;
  2.  
  3. namespace ConsoleApplication1
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             const string newLineLiteral = @"
  10. "; // Tab/Enter
  11.             Console.WriteLine(newLineLiteral == Environment.NewLine); // true
  12.  
  13.             const string newLineChars = "\r\n";
  14.             Console.WriteLine(newLineChars == Environment.NewLine); // true
  15.             Console.Read();
  16.         }
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement