Is it possible to concatenate two strings in soy (Closure Templates)?

851 views Asked by At

With soy, I would like to concatenate two strings (hard-coded or variables) into one. My idea was to "parametrize" the first variable with the second:

{let $key: 'abc_$anothervariable' /}

This doesn't work. I also tried using builtin join() function for lists:

{let $key: join(['abc', $anothervariable], '') /}

But this approach doesn't work either - it even seems to have invalid syntax. Is it even possible to do something like that in Closure Templates?

1

There are 1 answers

0
magnes On BEST ANSWER

The answer actually turned out to be as easy as:

{let $key: 'abc_' + $anothervariable /}