Besides using a loop. An int array can be initialized with 0s easy like arr = Enumerable.Range(0, 100).Select(i => new int[100]).ToArray();.
Is there a way I can initialize a string or char array in a similar fashion?
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.
I think you’re looking for:
Updated
Actually it would probably be slightly more efficient to do: