[英]How do I create a string from a block of text that contains the " character
我有一块html代码,其中包含一些表单动作的东西,它们“出现了很多。
有没有办法让整个块成为一个字符串?
public string methodName()
{
return @ " text goes here.. blah blah <p> a bit of html stuff</p>
<form action="www...." method="post">
<input type="hidden" name="cmd"
我从这里得到了许多愤怒的红色下划线。
var html = @"<html>
<body>
<span id=""name""> somethnig more</span>
</body>
</html>";
在字符串之前放置@意味着不应该解析内容(\\ n和其他控制字符不起作用)。 它还意味着字符串可以跨越多行,并且“只要你写”“(只显示一行)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.