Developer / Architect and not the other way around
Developer / Architect and not the other way around is a blog about software development.
Wednesday, October 13, 2010
Fizz Bang in Linq
var results = (from item in Enumerable.Range(1, 100)
where (item % 3).Equals(0) || (item % 5).Equals(0)
select item).Select((i => (i % 3).Equals(0) ? ((i % 5).Equals(0) ? "Fizz Bang" : "Fizz") : "Bang"));
No comments:
Post a Comment
‹
›
Home
View web version
No comments:
Post a Comment