You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Jonathan Jackson <Jo...@Dartmouth.EDU> on 2001/07/09 16:25:37 UTC

Concatenating string variables in Velocity

Is there any way to concatenate two strings into one in a
velocity template? For example, how would I do something
like the following:

#set($str1 = "one")
#set($str2 = $str1+" "+$str2)

This example isn't useful in and of itself, but it shows the
sort of thing I'd like to be able to do. Anybody know how to
do this, or even if it's possible?

-Jonathan Jackson

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: Concatenating string variables in Velocity

Posted by Jason van Zyl <jv...@apache.org>.
On 7/9/01 10:25 AM, "Jonathan Jackson" <Jo...@Dartmouth.EDU>
wrote:

> Is there any way to concatenate two strings into one in a
> velocity template? For example, how would I do something
> like the following:
> 
> #set($str1 = "one")
> #set($str2 = $str1+" "+$str2)

${str1}${str2}

> 
> This example isn't useful in and of itself, but it shows the
> sort of thing I'd like to be able to do. Anybody know how to
> do this, or even if it's possible?
> 
> -Jonathan Jackson
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org

-- 

jvz.

Jason van Zyl

http://tambora.zenplex.org
http://jakarta.apache.org/turbine
http://jakarta.apache.org/velocity
http://jakarta.apache.org/alexandria
http://jakarta.apache.org/commons



---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org