Search code examples
c#stringcarriage-return

How can I create a carriage return in my C# string


I have C# code that creates HTML. One particular piece of code creates a long string which is no problem for the browser. However when I look at the code with view > source it's difficult to see what's happening.

Is there some way that I can insert a carriage return or new line into my string so that it will make the string continue on the next line.


Solution

  • You can put \r\n in your string.