3 ms·
It gets better, though. C# 3.0 also has query expressions, which are even closer to Python's list comprehensions. Also, I think String.Join(sep, enumerable) wou
by benhoyt 14y ago
It gets better, though. C# 3.0 also has query expressions, which are even closer to Python's list comprehensions. Also, I think String.Join(sep, enumerable) would be more efficient than repeated string concatenation with + (given that C# strings are immutable, it'd have to reallocate and copy bytes each time, just like in Python).
So we'd have:
String.Join("\n", from x in mylist where x.Description() != ""
select x.Description());
Hardly looks like a statically typed language anymore, does it?