Re: Last row in foreach loop

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Jon Skeet [C# MVP] wrote:
tshad <tshad@xxxxxxxxxxxxxx> wrote:
Is there a way to know if you are looking at the last record record of foreach loop other then setting up a loop counter that you manually increment?

There is using "SmartEnumerable" from my (free) MiscUtil library:

http://pobox.com/~skeet/csharp/miscutil/usage/smartenumerable.html

Nice :)
'When C# 3 is released, this pattern will be made even simpler with'

Any chance for that update ? :-)

See ya
Søren Reinke
.



Relevant Pages

  • Re: subroutine call makes foreach exit?
    ... First, any metacharacters it contains ... is that pattern going to mistakenly ... then mysteriously exits the foreach loop which surrounds ... idea for that sub to modify any variables from the surrounding scope; ...
    (perl.beginners)
  • Re: Last row in foreach loop
    ... tshad wrote: ... foreach loop other then setting up a loop counter that you manually ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Last row in foreach loop
    ... foreach loop other then setting up a loop counter that you manually ... I have done someting like this with: ...
    (microsoft.public.dotnet.languages.csharp)