Check if the number of items in the array is equal to the expected number. - CSharp System

CSharp examples for System:Array Equal

Description

Check if the number of items in the array is equal to the expected number.

Demo Code


using System.Globalization;
using System.Collections.Generic;
using System.Collections;
using System;/*from   ww w . ja  va 2s . c  o  m*/

public class Main{
        /// <summary>
      /// Check if the number of items in the array is equal to the expected number.
      /// </summary>
      /// <param name="array"></param>
      /// <param name="expectedRank"></param>
      /// <returns></returns>
      public static bool IsDifferentRank (Array array, int expectedRank)
      {
         if (array == null)
            return false;
         return array.Rank == expectedRank;
      }
}

Related Tutorials