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 205 views
1 answer 224 views
3 answers 380 views
1 answer 213 views
1 answer 138 views
1 answer 260 views
1 answer 294 views
...