So let’s say I have an array of strings in C#, I could convert this array of strings to an array of integers using the following LINQ statement:
(new[] {"1", "2", "3"}).Select(x => int.parse(x))
Is there a Ruby equivalent to this?
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.
Not quite sure what
Selectmeans in C#, but converting an array of strings to array of integers is quite simple:["1", "2", "3"].map(&method(:Integer))