IEnumerator<T>

noun

say it: “EYE ih-NOO-mer-ay-ter” /aɪ ɪˈnuːməreɪtər/

The C# interface for an object that moves through a sequence, with MoveNext() and Current.

What is IEnumerator<T> in C#?

IEnumerator<T> — An interface for an object that moves through a sequence one item at a time.

class PlaylistReader
{
    IEnumerator<string> Reader(IEnumerable<string> songs)
    {
        return songs.GetEnumerator();
    }
}

In a sentence

  • “The list's IEnumerator moves to each book with MoveNext().”

Level: Freelancer · More C# terms at this level

Updated