title: How could I take 1 more item from Linq's TakeWhile?
body: <p>(line of code of interest is the last one, the rest is just for a full representation)</p>
  
  <p>Using the following code, I wanted to take VOTERS until I <strong>exceeded</strong> the maximum votes needed, but it stops right before reaching that maximum number of votes, so my voters pool has 1 fewer voter than I wanted. </p>
  
  <p>Is there a clean way in LINQ where I could have made it take votes UNTIL it reached the maximum numbers of votes? I know I could add one more voter or do this in a loop but I am curious if there was a good way to do this with LINQ instead.</p>
  
  <pre><code>var voters = new List&lt;Person&gt;
                               {
                                   new Person("Alice", Vote.Yes ),
                                   new Person("Bob", Vote.Yes),
                                   new Person("Catherine", Vote.No),
                                   new Person("Denzel", Vote.Yes),
                                   new Person("Einrich", Vote.Abstain),
                                   new Person("Frederica", Vote.Abstain),
                                   new Person("Goeffried", Vote.Abstain),
                               };
              voters.Single(c =&gt; c.Name == "Alice").Voices = 100;
              voters.Single(c =&gt; c.Name == "Bob").Voices = 150;
              voters.Single(c =&gt; c.Name == "Catherine").Voices = 99;
              voters.Single(c =&gt; c.Name == "Denzel").Voices = 24;
              voters.Single(c =&gt; c.Name == "Einrich").Voices = 52;
              voters.Single(c =&gt; c.Name == "Frederica").Voices = 39;
              voters.Single(c =&gt; c.Name == "Goeffried").Voices = 99;
  
  // this takes voters until we are BEFORE reaching X voices...
  int voicesSoFar = 0;
  int voicesNeeded = 300;
  var eligibleVoters = voters.TakeWhile((p =&gt; (voicesSoFar += p.Voices) &lt; voicesNeeded ));
  </code></pre>