2010-08-25

Case-insensitive XPath Search

An example of case-insensitive xpath search: to find all the contact items whose name contain 'mac', 'MAC', 'Mac' and so on.

string lookfor = "Mac"
query = "/contacts/contact" + "[contains(lower-case(name),'"+ lookfor.toLowerCase() + "')]";

Refernece:
http://geekswithblogs.net/ranganh/archive/2005/09/12/53520.aspx

No comments:

Post a Comment