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:aoi...@gmail.com] 
Gesendet: Freitag, 5. Juni 2009 08:45
An: user@ant.apache.org
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

aoi...@gmail.com

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@ant.apache.org For additional 
commands, e-mail: user-h...@ant.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@ant.apache.org
For additional commands, e-mail: user-h...@ant.apache.org

Reply via email to