Single quotes should work with
.Contains()
extension method, not unless if the text contains double quotes.
I've just verified with this example:
using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
public class Program
{
public static void Main()
{
string expression = "//*[local-name()='ClaimInfo']";
List<string> listExp = new List<string>();
listExp.Add("a");
listExp.Add("b");
listExp.Add("c''");
listExp.Add("//*[local-name()='ClaimInfo']");
var result = listExp.Where(o => o.Contains(expression));
if(result.Any())
Console.WriteLine(result.First());
}
}
You need to verify the actual value of
vocab.Expression
that you compare to your
expression
value that you passed into your Contains method.