How to remove the first element from an array in C#

1 Answer

0 votes
using System;
using System.Linq;

class Program
{
    static void Main() {
        int[] array = { 1, 2, 3, 4, 5, 6 };
        
        array = array.Skip(1).ToArray();
 
        Console.WriteLine(String.Join(", ", array));
    }
}




/*
run:

2, 3, 4, 5, 6

*/

 



answered Feb 25, 2021 by avibootz

Related questions

1 answer 210 views
1 answer 229 views
3 answers 388 views
1 answer 218 views
1 answer 142 views
1 answer 264 views
1 answer 299 views
...