ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ben Gill" <Ben.G...@t-mobile.co.uk>
Subject RE: Converting first char in a string to lower case
Date Fri, 15 Oct 2004 09:59:22 GMT
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:rambiusparkisanius@yahoo.com] 
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 <Ben.Gill@t-mobile.co.uk> 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: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message