Last active
February 11, 2019 17:16
-
-
Save dsibinski/798ba2d501ecdbca5c4fe29e5c4ff5a3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var array = new[] { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H' }; | |
Index idx1 = 2; // 2nd element from the beginning | |
Index idx2 = ^3; // 3rd element from the end (^) | |
Console.WriteLine($"{array[idx1]}, {array[idx2]}"); // prints "C, F" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment