ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "jan casteels" <jan_caste...@msn.com>
Subject Re: AW: First char Uppercase
Date Thu, 28 Nov 2002 12:24:40 GMT
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: Jan.Materne@rzf.fin-nrw.de
>Reply-To: "Ant Developers List" <ant-dev@jakarta.apache.org>
>To: ant-dev@jakarta.apache.org
>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:jan_casteels@msn.com]
> > Gesendet am: Donnerstag, 28. November 2002 04:13
> > An: ant-dev@jakarta.apache.org
> > 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:ant-dev-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail:
> > <mailto:ant-dev-help@jakarta.apache.org>
> >


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


--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message