Render List of Lists with StringTemplate

1.1k Views Asked by At

Please help me to render the following Java structure with StringTemplate:

List<List<String>> listOfListsOfStrings;

The output should be as follows (where ListXStringY is a string contained in position X, Y):

  • List1String1, List1String2, ...
  • List2String1, List2String2, List2String3, ...
  • ...
  • ListNString1, ...

The number of strings in different second-level lists can vary. Thank you!

1

There are 1 best solutions below

0
On

Try using nested iterators:

$list:{<li>$it:{$it$,}$</li>}$

Should print:

<li>List1String1,List1String2,</li><li>List2String1,List2String2,List2String3,</li>