Thanks,

I was aware of the javascript functionality, but was hoping that there was another way. But seems that I will need to use this way of working.
Thanks for the effort


Jan






From: [EMAIL PROTECTED]
Reply-To: "Ant Developers List" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: AW: First char Uppercase
Date: Thu, 28 Nov 2002 08:11:56 +0100

I did a little try ... and it works (for me):

<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>


Jan ... Mat�rne :-)

> -----Urspr�ngliche Nachricht-----
> Von: jan casteels [mailto:[EMAIL PROTECTED]
> Gesendet am: Donnerstag, 28. November 2002 04:13
> An: [EMAIL PROTECTED]
> Betreff: First char Uppercase
>
>
> Hi,
>
> I need to change the first char of a property to uppercase.
>
> foo needs to be changed to Foo where foo was stored in a property.
>
> How can I do this?
>
>
> Jan
>
>
>
>
>
> _________________________________________________________________
> MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.
> http://join.msn.com/?page=features/virus
>
>
> --
> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
>


_________________________________________________________________
The new MSN 8: advanced junk mail protection and 2 months FREE* http://join.msn.com/?page=features/junkmail



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



Reply via email to