I had a snippet in my snippet-lib ...
<?xml version="1.0" encoding="ISO-8859-1"?>
<project>
<property name="configs" value="FooName1:FooType1,FooName2:FooType2" />
<scriptdef name="split" language="javascript">
<attribute name="value"/>
<attribute name="sep"/>
<attribute name="prefix"/>
<![CDATA[
values = attributes.get("value").split(attributes.get("sep"));
for(i=0; i<values.length; i++) {
project.setNewProperty(attributes.get("prefix")+i, values[i]);
}
]]>
</scriptdef>
<split value="${configs}" sep="," prefix="sc."/>
<echoproperties prefix="sc"/>
</project>
Maybe that helps.
Jan
>-----Ursprüngliche Nachricht-----
>Von: Krist van Besien [mailto:[EMAIL PROTECTED]
>Gesendet: Montag, 8. August 2005 14:26
>An: [email protected]
>Betreff: extracting part of a property.
>
>Hello,
>
>I am trying to figure out if I could get ant to do some string
>manipulation.
>Suppose I have a property with value: "foo_0.01 and I want to
>split this on the _ character and put "foo" and "0.01"
>each in a different property to use further down in my ant script.
>
>How would I do this?
>
>Krist
>
>
>
>--
>[EMAIL PROTECTED]
>Solothurn, Switzerland
>
>---------------------------------------------------------------------
>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]