如何创建我的C#字符串回车 [英] How can I create a carriage return in my C# string

查看:126
本文介绍了如何创建我的C#字符串回车的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个创建HTML C#代码。一个代码特定部分产生的长字符串这是浏览器没有问题。然而,当我看到与视图代码>源代码是很难看到发生了什么。

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.

谢谢,

推荐答案

您可以把 \r\\\
在你的字符串。

You can put \r\n in your string.

这篇关于如何创建我的C#字符串回车的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆