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
            myProject.setProperty("Myprop",uppercaseValue);

        ]]> </script>

        <!-- Display the values -->
        <echo>myprop=${myprop}</echo>
        <echo>Myprop=${Myprop}</echo>

    </target>
</project>


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 [mailto:[EMAIL PROTECTED]]
Gesendet am: Sonntag, 9. Februar 2003 18:56
An: [EMAIL PROTECTED]
Betreff: upper case first letter of a file


Hi!

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,

Bjoern


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to