You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Peter Lammich <la...@ls5.cs.uni-dortmund.de> on 2003/01/31 14:45:10 UTC
Re: Beginner String concatenation question
This should work:
#set($array = $object.ParameterTypesArray)
#foreach($par in $array)
#set( $temp = "$!temp $par")
#end
jimmy coyne wrote:
> Hi all
> Im using velocity 1.3 and am trying to add afew string together like I
> would do in the
> Following java code
>
> String x[] = {
> "jim", "tim", "bob"};
> String st = "";
>
> for (int i = 0; i < x.length; i++) {
>
> st += x[i];
> }
>
> }
>
> st , of course is equal jimtimbob
>
> ive tried to use the following code for velocity , which does not work
>
> #set($array = $object.ParameterTypesArray)
> #foreach($par in $array)
> #set( $temp += $par)
> #end
>
> How do I do this String concatenation ?
>
> thanks
> jim
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org