P
P
ProblemBook.NET
Search…
P
P
ProblemBook.NET
ProblemBook.NET
LANGS
Задачник.NET
ProblemBook.NET
Oop
Strings
Linq
“YieldExceptionYield” (Problem)
“QueryAfterRemove” (Problem)
“ClosureAndVariable” (Problem)
“QueryWithInc” (Solution)
“QueryWithInc” (Problem)
“LifeAfterYield” (Solution)
“LifeAfterYield” (Problem)
“EnumerableToArray” (Solution)
“EnumerableToArray” (Problem)
«YieldExceptionYield» (Solution)
“ExceptionYieldYield” (Solution)
“ClosureAndForeach” (Solution)
“TryYieldFinally” (Problem)
“ClosureAndFor” (Solution)
“ExceptionYieldYield” (Problem)
“YieldExceptionYield” (Solution)
“ClosureAndForeach” (Problem)
“ClosureAndVariable” (Solution)
“QueryAfterRemove” (Solution)
“ClosureAndFor” (Problem)
Multithreading
ValueTypes
Math
Summary
Introduction
Attribution-NonCommercial-NoDerivatives 4.0 International
Powered By GitBook
“QueryAfterRemove” (Solution)

Answer

1
1
Copied!

Explanation

When you call list.Where(c => c.StartsWith("B")), query will only built, but not executed. The actual execution begins at the moment of the call query.Count(). By this time, the value of list will be { "Foo", "Baz" }, and hence, there exists only one element that starts with the 'B' letter.
​Problem​
Previous
“ClosureAndVariable” (Solution)
Next
“ClosureAndFor” (Problem)
Last modified 3yr ago
Copy link
Contents
Answer
Explanation