OK I got it to work Just using my_string.split("character_to_split_on")


Brent Gray wrote:
> 
> Hi - thanks Christopher 
> 
> On the first option
> 
> * Interpret the string as an array yourself, perhaps like this:
> #foreach($key in $keyString.split(',[ ]?'))
> 
> is .split() a Velocity function? Is there any documentation on how it
> works as I am not familier with it.
> 
> Thanks 
> 
> 
> Christopher Schultz-2 wrote:
>> 
>> Brent,
>> 
>> Brent Gray wrote:
>>> Any suggestion on how to correctly reference an array in the properties
>>> file?
>> 
>> As you are observing, Properties.get just returns a String, not an 
>> array. You need to do one of the following:
>> 
>> * Interpret the string as an array yourself, perhaps like this:
>> #foreach($key in $keyString.split(',[ ]?'))
>> 
>> * Wrap your Properties object with something that knows how to interpret 
>> a String as an array (or other collection) -- probably splitting on 
>> commas or something
>> 
>> * Use a class that already knows how to do this, such as 
>> ExtendedProperties from the commons-collections project (see the 
>> getStringArray method) -- note that ExtendedProperties appears to 
>> recommend using PropertiesConfiguration from commons-configuration 
>> instead... perhaps they will be deprecating it and/or removing it
>> altogether
>> 
>> Hope that helps,
>> -chris
>> 
>> 
>>  
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Creating-an-array-list-in-a-properties-file-tp18855189p18866653.html
Sent from the Velocity - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to