Array Collection in ASP.Net C#

Array is a collection of similar data type. It
contains the fixed length with same data type.

int[] arr=newint[10]; // One dimension

Here the int array contains the 10 item, item starting from 0 to 9.

Array indexing is start with zero (0th- position)
and the last position is total minus one (Total no of array -1). But dynamic
array not have predefined size. It dynamically manages the size when you add the
item in the list.

Types of Arrays

One-dimensional Arrays

Two-dimensional Arrays

Jagged Arrays

Mixed Arrays

1. One-dimensional Arrays

double[] doubleArray = newdouble[15];

char[] charArr = newchar[15];

bool[] boolArr = newbool[20];

string[] stringArr = newstring[100];

Array Properties

IsFixedSize => Return a value indicating if an array has a
fixed size or not.

IsReadOnly => Return a value indicating if an
array is read-only or not.

LongLength => Return a 64-bit integer that
represents total number of items in all the dimensions of an array.

Length => Return a 32-bit integer that
represents the total number of items in all the dimensions of an array.