简体   繁体   English

你如何比较Ant中的字符串?

[英]How do you compare strings in Ant?

In ant 1.6x the condition is never true despite app.get.method=download, why doesnt this work? 在ant 1.6x中,尽管app.get.method = download,但条件永远不会成立,为什么这不起作用?

 <target name="-get-method">
    <condition property="do.download">
        <equals arg1="${app.get.method}" arg2="download" />
    </condition>  
    <echo message="${do.download}" />
  </target> 

Properties in ant are global and immutable. ant中的属性是全局的,不可变的。 You have probably already set the do.download property somewhere else. 您可能已经在其他地方设置了do.download属性。

Trying printing the value of do.download BEFORE the condition element it will probably already be "false". 尝试打印do.download的值在条件元素之前,它可能已经是“假”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM