Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/275.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何将xpath声明为字符串变量?C#_C#_.net_String_Xpath_Escaping - Fatal编程技术网

如何将xpath声明为字符串变量?C#

如何将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\”、\“\”)))”可能对您有所帮助。可能存在重复的

如何在C#中将以下xpath值声明为字符串变量


值:
/*[包含(concat(“,@class,”),concat(“,“lit movie”,”)]
您必须使用转义字符(使用反斜杠),因此
应替换为
\”

string xpath=“//*[contains(concat(\“\”、@class、\“\”)、concat(\“\”、\“lit movie\”、\“\”)))”

可能对您有所帮助。可能存在重复的