Reputation: 6461
In groovy I can do:
def (zip111, zip222, zip333) = ["111", "222", "333"];
But I can't do:
String (zip111, zip222, zip333) = ["111", "222", "333"];
Is there anyway I can multiply assign Strings?
Thanks
Upvotes: 2
Views: 3751
Reputation: 171154
You need to do:
def (String zip111, String zip222, String zip333) = ["111", "222", "333"]
Or, pre-define your vars:
String zip111, zip222, zip333
(zip111, zip222, zip333) = ["111", 3, "333"]
Upvotes: 7