Reputation: 11377
In a Play template file I would like to split a string and assign each part to a variable. However, the following does not work:
@for(x <- a) {
@defining(x.split("""\.""")) { Array(x1, x2) =>
...
}
}
Any ideas?
Upvotes: 0
Views: 471
Reputation: 12783
You forgot the case
keyword.
@for(x <- a) {
@defining(x.split("""\.""")) { case Array(x1, x2) =>
...
}
}
Upvotes: 1