Iteratoren mit yield

using System.Collections.Generic;

IEnumerable<int> Range (int lo, int hi) {
    for (int x = lo; x < hi ; x++) {
       yield return x;
    }
    yield break;
}



Johannes Waldmann 2012-06-25