Skip to content

IEnumerator Extensions

Andrzej Kebab edited this page Feb 4, 2024 · 3 revisions

UtilityLibrary.Core

ToEnumerable

Converts an IEnumerator<T> to an IEnumerable<T>.

IEnumerator<T> source = // initialize your IEnumerator<T>
IEnumerable<T> enumerable = source.ToEnumerable();

Parameters:

  • source: An instance of IEnumerator<T>.

Returns:

  • enumerable: An IEnumerable<T> with the same elements as the input instance.

Clone this wiki locally