Using string array in C#
To create a stirng array we can define array of string type and length of array.
string[]arr = new string[5];
We can assign value to array by using index of array. Similarly we can get value by using index of array.
Assigning value to array
arr[0] = "One";
arr[1] = "Two";
arr[2] = "Three";
arr[3] = "Four";
arr[4] = "Five";
Getting value from array
string val = arr[2];
Comments
Post a Comment