/ Published in: C#
Expand |
Embed | Plain Text
class util { public static IEnumerable<int> Range(int min, int max) { while (true) { if (min >= max) { yield break; } yield return min++; } } } //Usage foreach (int notToUseVariable in util.Range(0,10)) { btn[notToUseVariable] = notToUseVariable.ToString(); }
You need to login to post a comment.
