[stringtemplate-interest] formatting the last element of a list

Terence Parr parrt at cs.usfca.edu
Tue May 29 15:21:01 PDT 2007


You need the latest build. 3.0 doesn't have this feature.

http://www.stringtemplate.org/download/build

Ter
On May 29, 2007, at 2:55 PM, George Berger wrote:

>> Try trunc(list) :)
>
> I tried this but got nothing back.  Here's my test program:
>
>   names [$names$].
>
>   first(names) [$first(names)$].
>   rest(names) [$rest(names)$].
>
>   trunc(names) [$trunc(names)$].
>   last(names) [$last(names)$].
>
> Here's the output:
>
>   names [JoeBobAlice].
>
>   first(names) [Joe].
>   rest(names) [BobAlice].
>
>   trunc(names) [].
>   last(names) [Alice].
>
> I'm using stringtemplate-3.0.jar.  Do I need something more recent?
>
> George
> _______________________________________________
> stringtemplate-interest mailing list
> stringtemplate-interest at antlr.org
> http://www.antlr.org:8080/mailman/listinfo/stringtemplate-interest



More information about the stringtemplate-interest mailing list