Check out example codes for "get last element of array c#". It will help you in understanding the concepts better.

Code Example 1

using System;

public class Demo {
   public static void Main() {
      string[] str = new string[] {
      foreach(string res in str) {
      Console.WriteLine("Last element: "+str[str.Length - 1]);

Code Example 2

string[] str = new string[] {"Java","HTML","jQuery"};
Console.WriteLine("Last element: "+str[str.Length - 1])

Learn ReactJs, React Native from