ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject AW: upper case first letter of a file
Date Mon, 10 Feb 2003 07:21:21 GMT
For a similar question I wrote a sample:

<project name="myProject" basedir="." default="foo">
    <property name="myprop" value="foo" />
    <target name="foo">
        <!-- Using Javascript functions to convert the string -->
        <script language="javascript"> <![CDATA[

            // getting the value
            lowercaseValue = myProject.getProperty("myprop");

            // the first character
            ch = lowercaseValue.substring(0,1);

            // the rest of the value
            rest = lowercaseValue.substring(1);

            // convert first character to uppercase
            up = ch.toUpperCase();

            // concatenate the uppercase with the rest
            uppercaseValue = up + rest;

            // store the result in a new property

        ]]> </script>

        <!-- Display the values -->


It will upcase the first character of a properties value.
	${myprop} = foo
	${Myprop} = Foo
Does it help?

Jan Matèrne

-----Urspr√ľngliche Nachricht-----
Von: Bjoern Eger []
Gesendet am: Sonntag, 9. Februar 2003 18:56
Betreff: upper case first letter of a file


I use the style task to generate Java source files from XML input files.

The XML file names start with a lower case letter, so the resulting Java 
source files
also start with a lower case letter. I want to follow the Java code 
conventions, so the
Java files should start with a upper case letter.

Is there a way to capitalize the file names?
Can I maybe use move/mapper task?

Best Regards,


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

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message