简体   繁体   中英

how to declare xpath as a string variable? C#

How can I declare the following xpath value as a string variable in C#?

Value: //*[contains(concat( " ", @class, " " ), concat( " ", "lit-movie", " " ))]

您必须使用转义字符(使用反斜杠),因此"应替换为\\"

string xpath = "//*[contains(concat( \\" \\", @class, \\" \\" ), concat( \\" \\", \\"lit-movie\\", \\" \\" ))]";

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM