views:

86

answers:

1

hi there. I want to searching in a xml file. this is my linq sentece.

string _sSemptom  = "try";
XElement xe =  from c in xdSemptom.Elements().Elements().Elements()
                         .Elements().Attributes("Isim")
               where c.Value.Length >= _sSemptom.Length &&
                     c.Value.Contains(_sSemptom)
               select c.Parent

I can find the XElement that way, but if _sSemptom is "Try" I can't find it. How can I search using upper and lower case variations?

Thanks for your helps.

+4  A: 

Edit: Actually, it turns out there isn't a StringComparison overload for Contains(). You can use IndexOf() instead:

c.Value.IndexOf(_sSemptom, StringComparison.OrdinalIgnoreCase) > -1
dahlbyk