groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Les Hartzman <>
Subject Syntax question using (identifier 1, identifier 2) on LHS of =
Date Fri, 27 Jan 2017 18:15:14 GMT

I just saw a reference to using the above syntax, specifically as follows:

   def (string1, string2) = "part1-part2".tokenize("-")

This assigns string1 "part1" and string2 "part2".

So my main question is what is this referred to as?

You can't do:

   String (string1, string2) =  "part1-part2".tokenize("-")

I did find out that you can do:

   String string1
   String string2
   (string1, string2) =  "part1-part2".tokenize("-")



View raw message