如何将xpath声明为字符串变量?C#
如何在C#中将以下xpath值声明为字符串变量如何将xpath声明为字符串变量?C#,c#,.net,string,xpath,escaping,C#,.net,String,Xpath,Escaping,如何在C#中将以下xpath值声明为字符串变量 值:/*[包含(concat(“,@class,”),concat(“,“lit movie”,”)]您必须使用转义字符(使用反斜杠),因此“应替换为\”: string xpath=“//*[contains(concat(\“\”、@class、\“\”)、concat(\“\”、\“lit movie\”、\“\”)))”可能对您有所帮助。可能存在重复的
值:
/*[包含(concat(“,@class,”),concat(“,“lit movie”,”)]
您必须使用转义字符(使用反斜杠),因此“
应替换为\”
:
string xpath=“//*[contains(concat(\“\”、@class、\“\”)、concat(\“\”、\“lit movie\”、\“\”)))”代码>可能对您有所帮助。可能存在重复的