It’s interesting a clearer, shorter and more compact solution than
IEnumerator<T> GetEvens<T>(List<T> list) { for (int i = 1; i < list.Count; i += 2) { yield return list[i] } }
It’s interesting a clearer, shorter and more compact solution than
IEnumerator<T> GetEvens<T>(List<T> list) { for (int i = 1; i < list.Count; i += 2) { yield return list[i] } }
Source: https://ru.stackoverflow.com/questions/10813/
All Articles