how to declare string array?
how to declare string array?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Aug 1, 2013, 5:56 AM
string[] numbers = new string[5]{"1", "2", "3", "4", "5"};
or:
string[] numbers = new string[]{"1", "2", "3", "4", "5"}; // compiler works out number of elements
or simply:
string[] numbers = {"1", "2", "3", "4", "5"}; // compiler deduces type and size
Iftikar HussainPosted Aug 1, 2013, 5:56 AM
You can declare like this
Regards,
Iftikar