Array.GetUpperBound : Array « System « C# / C Sharp by API






Array.GetUpperBound

   


using System;

public class ArrayTest {

    public static void Main( ) {
       int[] array_1 = new int[5];
      
       for( int i = array_1.GetLowerBound(0); i <= array_1.GetUpperBound(0); i++)
          array_1[i] = i+1;

       for( int j = array_1.GetLowerBound(0); j <= array_1.GetUpperBound(0); j++)
          Console.WriteLine("array_1[{0}] = {1}", j, array_1[j]);

    }
}

   
    
    
  








Related examples in the same category

1.Array.AsReadOnly
2.Array.BinarySearch
3.Array.Clone
4.Array.ConvertAll
5.Array.Copy
6.Array.CopyTo
7.Array.Count
8.Array.CreateInstance
9.Array.Exists
10.Array.Find
11.Array.FindAll
12.Array.ForEach
13.Array.GetEnumerator()
14.Array.GetLength()
15.Array.GetLowerbound
16.Array.IndexOf
17.Array.LastIndexOf
18.Array.Length
19.Array.Rank
20.Array.Resize
21.Array.Reverse
22.Array.Reverse(nums, 1, 3)
23.Array.Sort
24.Array.Sort(names, Comparer.DefaultInvariant)
25.Array.SyncRoot