In ruby, there is a indiom to create a array of strings like this:
names = %w( lucas Fred Mary )
Is there something like that in groovy?
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.
Most of the time you would create a list in groovy rather than an array. You could do it like this:
Alternately, if you did not want to quote everything like you did in the ruby example, you could do this: