By Team Escalera on 31 Oct 2017 02:55 PM
  • Arrays

Here lets create an array of Fruits (of same data type string)

Name of Our Array is mystrArray and it has 5 elements.


string[] mystrArray = new string[] { “Apple”, “Banana”, “Grapes”, “Mango”, “Pine-Apple” };
// Reading array items using foreach loop
foreach (string mystr in mystrArray)

By Team Escalera on 31 Oct 2017 02:58 PM
  • learn C#

This post is helpful if the task is : Providing Initial Values to an Array.

When an array is declared by using curly brackets we can provide initial values to it :

string[ ] cities= new string[3] {“Delhi”, “Mumbai”, “Lucknow”};

We can omit the size declaration when the number of elements are provided in the curly braces:

string[ ] cities= new string[ ] {“Delhi”, “Mumb...............

By Team Escalera on 31 Oct 2017 02:59 PM
  • learn C#

C# has  various classes that are built-in and they can store and manipulate data.
An example of such a class is the Array class.
In order to store a collection of data the data structure that is used in C# is known as array. It can be described as a collection of variables of the same type.
Let’s assume a situation where you need to store 250 numbers. One option is to declare 250 different var...............