I wanna do something like this. I know it’s wrong:
var a = from h in xdoc.Root.Elements()
where h.Element().value like = "1234"
select h;
I wanna do something like this. I know it’s wrong:
var a = from h in xdoc.Root.Elements()
where h.Element().value like = "1234"
select h;
I think that you want to get the elements that Contains
the 1234
value:
var a = from h in xdoc.Root.Elements()
where h.Element().Value.Contains("1234") // like '%1234%'
select h;
For the SQL-ish like '%value'
you can use EndsWith, and for like 'value%'
StartsWith
Use the helper methods of the String class, like StartsWith
or EndsWith
.
var a = from h in xdoc.Root.Elements()
where h.Element.value.Contains("1234")
select h
This would generate a 'LIKE' statement in the background.