C# New Line Carriage Return
You ever wonder why the .NET Development Team didn't just put the escape sequence characters into Constants? Well they did... Sort of!
Here are two samples of code that do the same thing:
// First Sample
StringBuilder sb = new StringBuilder();
sb.Add("This the first line,");
sb.Add("/r/n");
sb.Add("Here is the second line.");
// Second Sample
StringBuilder sb = new StringBuilder();
sb.Add("This the first line,");
sb.Add(System.Environment.NewLine);
sb.Add("Here is the second line.");
Notice how instead of using the escape sequence characters in the second example I used a built Constant that the .NET Team Provided for you and I. This method is so much cleaner and so much more understandable. This works great when you're working with someone that is new to the .NET Framework.
You should also check out what else they have the System.Environment Class.
Here's a link where you can get more escape sequence characters.
Here are two samples of code that do the same thing:
// First Sample
StringBuilder sb = new StringBuilder();
sb.Add("This the first line,");
sb.Add("/r/n");
sb.Add("Here is the second line.");
// Second Sample
StringBuilder sb = new StringBuilder();
sb.Add("This the first line,");
sb.Add(System.Environment.NewLine);
sb.Add("Here is the second line.");
Notice how instead of using the escape sequence characters in the second example I used a built Constant that the .NET Team Provided for you and I. This method is so much cleaner and so much more understandable. This works great when you're working with someone that is new to the .NET Framework.
You should also check out what else they have the System.Environment Class.
Here's a link where you can get more escape sequence characters.