...
StringTemplate will iterate across any object that it can reasonably interpret as a collection of elements such as arrays, lists, dictionaries and, in statically typed ports, objects satisfying iterable or enumeration interfaces.
General use of StringTemplate for formatting
The ST.format method is great for general use in general code.
| Deck of Cards | |||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||
|
Yields:
| Code Block |
|---|
int a[] = { 3, 9, 20, 2, 1, 4,
6, 32, 5, 6, 77, 888,
2, 1, 6, 32, 5, 6,
77, 4, 9, 20, 2, 1,
4, 63, 9, 20, 2, 1,
4, 6, 32, 5, 6, 77,
6, 32, 5, 6, 77, 3,
9, 20, 2, 1, 4, 6,
32, 5, 6, 77, 888,
1, 6, 32, 5 };
|