C# 如何检查rad编辑器内容中是否包含指定的标记

C# 如何检查rad编辑器内容中是否包含指定的标记,c#,asp.net,C#,Asp.net,我使用的是Telerik Rad编辑器。将VS2010与c#一起使用 在页面加载期间,我将内容绑定到编辑器 在ButtonClick事件中,我需要检查特定标记(例如:)是否在HTML模式下的内容中 我正在使用以下代码 if (Radeditor1.Content.Contains("<title/>")) { } if(Radeditor1.Content.Contains(“”) { } 标签有欢迎这样的价值 所以Content.contains将

我使用的是Telerik Rad编辑器。将VS2010与c#一起使用

在页面加载期间,我将内容绑定到编辑器

在ButtonClick事件中,我需要检查特定标记(例如:)是否在HTML模式下的内容中

我正在使用以下代码

    if (Radeditor1.Content.Contains("<title/>"))
    { 

    }
if(Radeditor1.Content.Contains(“”)
{ 
}
标签有欢迎这样的价值

所以Content.contains将其视为字符串并返回false

如何检查它

感谢和问候,
Pooja

我可能看错了,但如果您只想找到标签的开头,可以使用:

if (Radeditor1.Content.Contains("<title"))
{ 

}

if(Radeditor1.Content.Contains)(“否,我的内容值如下。candesartancilexetil Amias®)也许您可以发布Radeditor1.Content的确切内容以及您希望从Radeditor1.Content检查/检索的确切字符串
System.Text.RegularExpressions.Match match = System.Text.RegularExpressions.Regex.Match(Radeditor1.Content, @"\<title[^\<]*\>(?<content>.*?)\<\/title\>", RegexOptions.Multiline);
if (match.Success)
{
     string content = match.Groups["content"].Value;
}