SyntaxFix
Write A Post
Hire A Developer
Questions
Tags
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?
This question is related to arrays string groovy
arrays
string
groovy
If you really want to create an array rather than a list use either
String[] names = ["lucas", "Fred", "Mary"]
or
def names = ["lucas", "Fred", "Mary"].toArray()
Source: Stackoverflow.com