ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: How to Split a String in Ant?
Date Thu, 30 Oct 2003 16:15:11 GMT

>> My build file will be fed properties like "something_something_15", and 
>> I want a property generated that contains the string "15".  If the last 
>> part after the underscore is not a number, I want the property generated 
>> to have a value "9999".

> you can use the <script> task and write your own routine.  This is what I have
done.  I wonder if there is anything easier tho.

What about setting your properties like this:


This doesn't solve your problem for "9999", but you can still do this:

<property name="my.something.number" value="9999" />

... and the valud will only be set if it is not already set.

So, instead of parsing the property value, you simply use 


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message