Well, if you don't mind using the AntContrib package, you could do this
using the AntContrib's <for> ,  <if> ,  and the <variable> tasks to build
the string. I haven't tested it, but it would look something like this:

<for
    list="${list}"
    delimiter=","
    param="word">
    <sequential>
        <if>
            <isset property="newlist"/>
            <then>
               <variable name="newlist"
                  value="@{word},${newlist}"/>
            </then>
            <else>
               <variable name="newlist"
                   value="@{word}"/>
            </else>
       </if>
     </sequential>
</for>
<echo>Old List="${list}" New List="${newlist}"</echo>

I tried playing around with regular expressions, but I couldn't get one to
do reversing.

On Wed, Aug 5, 2009 at 5:45 AM, Raagu <rknilekani2...@gmail.com> wrote:

>
> Hello People
>
> I have a written a ant script which has a variable say "list" which
> contains
> list of names say name1,name2,ant,forum,nabble     . All r comma
> separated..
>
> I want to reverse this list such dat , after reversing "list" should give
> me
> nabble,forum,ant,name2,name1..
>
> And also Is there any option to discard  some of the values from list..??
> Please reply
> Thanks in advance
> --
> View this message in context:
> http://www.nabble.com/Reversing-a-list-tp24823814p24823814.html
> Sent from the Ant - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@ant.apache.org
> For additional commands, e-mail: user-h...@ant.apache.org
>
>


-- 
David Weintraub
qazw...@gmail.com

Reply via email to