Hello,
You use antcontrib, there you have the var type that will do the trick.
In the end you should move the result into a property.
Initialize it:
<var name="long-string.var" value= "" />
And in the loop:
<var name="long-string.var" value= "${long-string} @{str}" />
And move it to property:
<property name="long-string" value= "${long-string.var}" />
--
Jürgen Knuplesch
-----Ursprüngliche Nachricht-----
Von: Gao Lin [mailto:[email protected]]
Gesendet: Freitag, 5. Juni 2009 08:45
An: [email protected]
Betreff: How to concat string in ant
Hi:
I want to concat some strings from a list to one string line.
like:
<for list="${strs.list}" delimiter="," param="str">
<sequential>
<property name="long-string" value= " @{str}" />
<!-- Because property is immutable, the ${long-string} is the
first element of the list: ${strs.list} -->
</sequential>
</for>
for example above, if the list of ${strs.list} is: {a, b, c}, how can I get a
string with value: string = "a b c" ?
do you guys know what is better way to implement this WITHOUT writing own Task?
--
Thanks and Best Regards
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional
commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]