English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

3 answers

string[] myStrArray = new string[3];

Will create a new string array with 3 elements.

2007-03-07 12:13:41 · answer #1 · answered by Rex M 6 · 0 0

Declaring an Array:
int[] myIntArray = new int[5] { 1, 2, 3, 4, 5 };
//the above declares an array of 5 integers

Declaring a string
string MyString = "Here goes my string.";

2007-03-08 05:01:23 · answer #2 · answered by Smutty 6 · 0 0

Declare a C# array with the following syntax:
type[] array-name;

For example:
int[] myIntArray

Declare a C# String with the following syntax:
type[] String-name;
string myString;

You can even use in this way
string myString = "Hi there";

2007-03-07 20:58:46 · answer #3 · answered by asbharadwaj 5 · 0 1

fedest.com, questions and answers