benjaminvr

Enumerable.Range gedrag

Nov 27th, 2021
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.31 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3.  
  4. public class Program
  5. {
  6.     public static void Main()
  7.     {
  8.         foreach(int i in Enumerable.Range(1,10)){
  9.             Console.WriteLine(i);
  10.         } // 1,2,3,4,5,6,7,8,9,10
  11.        
  12.         foreach(int i in Enumerable.Range(10,10)){
  13.             Console.WriteLine(i);
  14.         } // 10,11,12,13,14,15,16,17,18,19
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment