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 120 views
1 answer 136 views
3 answers 224 views
1 answer 126 views
1 answer 61 views
1 answer 167 views
1 answer 185 views
...