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

George Berger george.berger
Tue May 29 14:55:19 PDT 2007


> 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


More information about the stringtemplate-interest mailing list