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

前端 未结 5 1481
无人共我
无人共我 2021-01-07 16:49

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

5条回答
  •  时光取名叫无心
    2021-01-07 17:36


    works for me

    So...

    String body = String.Format(@"New user: 
     
    Name: {0}
    Email: {1}
    Phone: {2}", Name, Email, Phone);

    Produces...

    New user:
    Name: Name
    Email: Email
    Phone: Phone

提交回复
热议问题