ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Beth Hechanova" <bhechan...@imsco-us.com>
Subject String manipulation (parsing / padding)
Date Mon, 04 May 2009 15:27:15 GMT
Hi,

 

I am looking for a way in Ant to parse a string as well as create a new
string that is zero-padded.  Does Ant have any built-in tasks/functions
for manipulating strings?

 

My input will be a version string in the format of x.y.z.  I need to
take that input and create a string that is formatted to exactly 6
characters, with each individual component of the original string
resulting in 2 characters in the result string (zero left padding if the
number is only one character).  So if my original string is 1.2.3, my
resulting string will be 010203.

 

I have been using NAnt lately and it has some built in functions for
doing this sort of string manipulation.  Now I need to implement the
same logic in Ant scripts.  I have been looking for something similar in
Ant, but I have yet to come across anything.  I am using Ant v1.7.1.

 

Thanks,

Beth

 


---------------------------------------------------------------------------
This email and any files transmitted with it are confidential & proprietary 
to Systems and Software Enterprises, Inc. (dba IMS).  This information is 
intended solely for the use of the individual or entity to which it is 
addressed. Access or transmittal of the information contained in this e-mail, 
in full or in part, to any other organization or persons is not authorized.
---------------------------------------------------------------------------


Mime
  • Unnamed multipart/alternative (inline, 7-Bit, 0 bytes)
View raw message