How can I assign empty to string array in c#?
string [] stack; //string array
how to assign
stack = ""; //this statement gives error cannot implicitly convert to type string to string []
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You cannot use:
Since stack in here is an array of string. If you want to initialize empty string for each elements in array, you can use LINQ with
Enumerable.Rangeto get the result, assume there are 10 items in here: