How to remove the first N elements from an array using Linq in C#

1 Answer

0 votes
using System;
using System.Linq;
 
class Program
{
    static void Main() {
        string[] array = { "c#", "java", "c", "python", "php", "c++", "go", "rust" };
        
        int N = 3;
        var result = array.Skip(N);
        
        Console.WriteLine(string.Join(", ", result));
    }
}
   
   
   
/*
run:
      
python, php, c++, go, rust
    
*/

 



answered Jul 5, 2023 by avibootz

Related questions

...