ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Loughran" <stev...@iseran.com>
Subject Re: matching a string in a property
Date Wed, 20 Mar 2002 06:04:10 GMT

----- Original Message -----
From: "Anthony Rodriguez" <Anthony@WeddingChannel.com>
To: <ant-user@jakarta.apache.org>
Sent: Tuesday, March 19, 2002 4:56 PM
Subject: matching a string in a property


> Hi, I have a question regarding finding a string in a property.  Say I
have
> a property like this:
>
> <property name="foo" value="a_very_short_string">
>
> Now I want to search that property for a string, let's say "short".  If
the
> property has "short" in it then I want to do task A.  If not, then do not
do
> task A.  Something like this:
>
> <condition property="doTaskA" value="true">
>    <exists key="short" inproperty="foo"/>    #made this up for
illustration
> purposes
> </condition>
>


that'll be the
<condition ...>
    <contains string="${foo}" substring="short"/>
</condition>

in the CVS tree only, not ant 1.4.1


--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message