velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shinobu Kawai <shinobu.ka...@gmail.com>
Subject Re: String Array in Velocity
Date Sun, 09 Jan 2005 13:25:44 GMT
Hi Ben,

> I have a String Array, how can I retrieve its value if I know the index?
> 
> Say I have this:
> 
> String[] values = new String[] { "1", "2" }
> 
> I have tried using this but it didn't work:
> 
> $values[1]

Velocity currently does not support direct access to array elements. 
For now, you can use the ArrayTool.
    http://wiki.apache.org/jakarta-velocity/ArrayTool

$array.get($values, 1)

Best regards,
-- Shinobu

--
Shinobu "Kawai" Yoshida <shinobu.kawai@gmail.com>

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


Mime
View raw message