ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Jan.Mate...@rzf.fin-nrw.de>
Subject AW: Substring
Date Wed, 02 Nov 2005 09:45:17 GMT
Hi Remo,

* first I would think about if it´s really needs modification. Do the build work? That´s
the main point here.
* second I would think if you _really_ need the slashes in the property. You could also write
a ${prop1}/${prop2}
  somewhere else.
* then you could define a 3rd property using its location attribute. Just have a look at the
example at the buttom.

Jan



<project>
    <property name="prop1" value="/my/folder/" />
    <property name="prop2" value="/my other folder/" />

    <property name="prop3value"    value="${prop1}${prop2}"/>
    <property name="prop3location" location="${prop1}${prop2}"/>
    <echo>value:    '${prop3value}'</echo>
    <echo>location: '${prop3location}'</echo>
</project>

Buildfile: build.xml
     [echo] value:    '/my/folder//my other folder/'
     [echo] location: 'C:\my\folder\my other folder'
BUILD SUCCESSFUL



>> Example:
>> Prop1: "/my/folder/"
>> Prop2: "/my other folder/"
>> 
>> Now I log:
>> File moved to: ${Prop1}${Prop2}
>> 
>> This logs:
>> "/my/folder//my other folder/"
>> 
>> The double slash is not nice... But I need all the slashes in
>> Prop1 and Prop2... So I need to do a substring action on one of the 
>> properties.
>> 
>> Remo

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


Mime
View raw message