如何将<div class =“thumbWrapper”>添加为字符串?</div>

时间:2014-12-20 12:45:40

标签: c# .net

我有这一行:

index = html.IndexOf("<div class="thumbWrapper">");

我需要以某种方式使用转义,因此将是一个字符串。

2 个答案:

答案 0 :(得分:4)

尝试verbatim strings@"<div class=""thumbWrapper"">"

答案 1 :(得分:3)

"转换为\"

int index = html.IndexOf("<div class=\"thumbWrapper\">");