Answers for "range index c#"

C#
0

range index c#

var array = new int[] { 1, 2, 3, 4, 5 };
var slice1 = array[2..^1];    // 3, 4 
var slice2 = array[..^3];     // 1, 2
var slice3 = array[2..];      // 3, 4, 5
var slice4 = array[..];       // 1, 2, 3, 4, 5
Posted by: Guest on September-20-2021

C# Answers by Framework

Browse Popular Code Answers by Language