How do I convert from a IEnumerable variable to an int[] in variable in c#?
Share
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.
Use the
.ToArray()extension method if you’re able to use System.LinqIf you’re in .Net 2 then you could just rip off how System.Linq.Enumerable implements the .
ToArrayextension method (I’ve lifted the code here almost verbatim – does it need a Microsoft®?):With this you simply can do this: