With .NET 4.0, I sometimes have a Guid[] or 200 items that all need conversion to string[], and sometimes I have to do the reverse.
What is the fastest/smartest way to do that?
Thanks.
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.
An alternative to LINQ is
Array.ConvertAll()in this case:Runtime performance is probably the same as LINQ, although it is probably a tiny bit faster since it’s going from and to array directly instead of an enumeration first.