I am having trouble converting the above LINQ statement to a lambda Where() equivalent.
What you want to do then is carefully read section 7.16.2 of the C# specification. It will walk you step-by-step through the process.
It says:
A query expression with a where clause
from x in e
where f
...
is translated into
from x in ( e ) . Where ( x => f )
...
So your query
from n in res
where n.Length > 0
select int.Parse(n);
is translated into
from n in (res).Where(n=>n.Length > 0)
select int.Parse(n)
That's the first stage of the translation. Now go back to the spec again:
A query expression of the form
from x in e select v
is translated into
( e ) . Select ( x => v )
So your translated-once-already query
from n in (res).Where(n=>n.Length > 0)
select int.Parse(n)
is further translated into
((res).Where(n=>n.Length > 0)).Select(n=>int.Parse(n))
and now it is not a query expression any more, so no more syntactic translation is done.