Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

C# removing the last value of an array

using System;
using System.Linq;

class RemoveLastElement {
  static void Main() {
    int[] a = { 2, 3, 4, 5, 6};
    int[] result = a.SkipLast(1).ToArray();

    Console.WriteLine(String.Join(",", result));
  }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #removing #array
ADD COMMENT
Topic
Name
5+3 =