You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bu...@apache.org on 2008/05/14 02:54:26 UTC

DO NOT REPLY [Bug 33253] a wrapper for the java.lang. String class to modify properties

https://issues.apache.org/bugzilla/show_bug.cgi?id=33253





--- Comment #8 from Colm Smyth <la...@gmail.com>  2008-05-13 17:54:26 PST ---
The feature proposal in principle seems sound. I would suggest changing the
parameter names to "argN" to be compatible with the existing Ant equals
feature, and the "src" attribute to "value".

However when you introduce substring() and length(), you also introduce the
requirement to do integer arithmetic on properties, using (say) an "evaluate"
task as follows:

<string property="fileNameLength" method="length" src="${fileName}" />
<evaluate property="fileNameLengthMinusExtension"
expression="${fileNameLength}-3" />
<string property="fileExtension" method="substring" src="{$fileName}"
param1="${fileNameLengthMinusExtension}" />

But when you consider the effort required to deliver these features, and the
effort to code and maintain the tasks in Ant XML, I wonder if
http://ant.apache.org/manual/OptionalTasks/script.html isn't a better answer?


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.