Hi,
ok i played a bit with PropertyRegex and it's much easier
as i thought, no writing of a new file required as with
filterchains and no complex regular expression needed.
So, if you still need it =
<property name="Prop1" value="/my/folder" />
<property name="Prop2" value="//my other folder/" />
<propertyregex property="bla"
input="${Prop1}${Prop2}"
regexp="//" replace="/"/>
<echo>$${bla} is ${bla}</echo>
Gilbert
-----Original Message-----
From: Remo Liechti [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 02, 2005 9:37 AM
To: Ant Users List
Subject: RE: Substring
Hi Gil
Is there no easy way to do it? :/ It's a bit overhead to write files for
this, isn't it ;)
If there is no other possibility I'll do it this way...
Thanks anyway,
Remo
> -----Original Message-----
> From: Rebhan, Gilbert [mailto:[EMAIL PROTECTED]
> Sent: Mittwoch, 2. November 2005 09:31
> To: Ant Users List
> Subject: RE: Substring
>
>
> Hi,
>
> echo ${Prop1}${Prop2} to yourfile.txt
> then use a filterchain when loading
> the contents of that file in a new property =
>
> <loadfile property="bla" srcfile="C:/yourfile.txt">
> <filterchain>
> <replacestring from="//" to="/" />
> </filterchain>
> </loadfile>
>
>
>
> <echo>${bla}</echo>
>
> gives you >>> /my/folder/my other folder/
>
> Gilbert
>
>
> -----Original Message-----
> From: Remo Liechti [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, November 02, 2005 8:46 AM
> To: Ant Users List
> Subject: Substring
>
> Good Morning
> Is it possible to to some string operations on a property?
>
> 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.
> I took a look at the documentation of ANT but did not found
> some string operations or stuff like this. I think there is
> such things, may be I looked at the wrong place. If so,
> please tell me where I have to look next time ;)
>
> Thank you
>
> Remo
>
> ____________________________________________________________
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED] For
> additional commands, e-mail: [EMAIL PROTECTED]
>
>
> ____________________________________________________________
> This message has been checked for all known viruses by Messagelabs.
>
---------------------------------------------------------------------
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]