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

George Berger george.berger
Tue May 29 10:02:46 PDT 2007


Hi -

I'm trying to figure out how to format a list that requires special
treatment for the last element.  E.g., given a list like this:

   [ "Joe", "Bob", "Alice" ]

I'd like to output a string that looks like this:

 Hello Joe, Bob, and Alice.

It seems like I need a function that corresponds to last() in the same way
that rest() corresponds to first(), but I don't see anything like that in
the docs.

Any suggestions for how to implement this would be appreciated.

George
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org:8080/pipermail/stringtemplate-interest/attachments/20070529/802176b2/attachment.html 


More information about the stringtemplate-interest mailing list