> For the complete documentation index, see [llms.txt](https://andreyakinshin.gitbook.io/problembookdotnet/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://andreyakinshin.gitbook.io/problembookdotnet/en/linq/queryafterremove-p.md).

# “QueryAfterRemove” (Problem)

What will the following code display?

```csharp
var list = new List<string> { "Foo", "Bar", "Baz" };
var query = list.Where(c => c.StartsWith("B"));
list.Remove("Bar");
Console.WriteLine(query.Count());
```

[Solution](/problembookdotnet/en/linq/queryafterremove-s.md)
