Excellent, Thanks Ivan, this works a treat!!

I had to use BSF 2.3.0 and the js.jar from Rhino15R3.zip (later versions
don't work!)

<?xml version="1.0" encoding="ISO-8859-1"?>
<project>

    <property name="prop" value="MixedContent"/>

    <scriptdef name="lc" language="javascript">
        <attribute name="property"/>
        <attribute name="value"/>
        project.setNewProperty(attributes.get("property"),
attributes.get("value").toLowerCase());
    </scriptdef>

    <scriptdef name="uc" language="javascript">
        <attribute name="property"/>
        <attribute name="value"/>
        project.setNewProperty(attributes.get("property"),
attributes.get("value").toUpperCase());
    </scriptdef>

    <lc property="lcProp" value="${prop}"/>
    <uc property="ucProp" value="${prop}"/>

    <echo>
      prop   = ${prop}
      lcProp = ${lcProp}
      ucProp = ${ucProp}
    </echo>

</project>

Regards



-----Original Message-----
From: Ivan Ivanov [mailto:[EMAIL PROTECTED] 
Sent: 15 October 2004 10:23
To: Ant Users List
Subject: Re: Converting first char in a string to lower case

Hello,
I think that this is possible <script> tasks. See here
for a similar sample:
http://marc.theaimsgroup.com/?l=ant-user&m=109156218522906&w=2
--- Ben Gill <[EMAIL PROTECTED]> wrote:

> Hi,
> 
>  
> 
> I have a string 'Foo' that I want to change to
> 'foo'.  Is there any way
> of doing this in ant?
> 
>  
> 
> I have looked at the regex stuff but I don't think
> that will do the
> job...
> 
>  
> 
> Does anyone have any other ideas?
> 
> 



                
_______________________________
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com

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



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

Reply via email to