如何在ant中将字符串转换为大写? [英] How do you convert a string to uppercase in ant?

查看:198
本文介绍了如何在ant中将字符串转换为大写?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:
蚂蚁字符串函数?

Possible Duplicate:
Ant string functions?

作为wix安装的一部分,我正在修改wxi文件并更新guid.作为"pedantic"警告设置的一部分,如果Guid小写,则wix构建失败.

I am modifying a wxi file as part of a wix install and updating a guid. As part of the "pedantic" warning setting if a guid is in lowercase the wix build fails.

如何在ant中将guid转换为大写字符串?

How can I convert the guid to an uppercase string in ant?

Ant字符串函数线程无疑是必经之路- Ant字符串函数?

The Ant string functions thread is definitly the way to go - Ant string functions?

推荐答案

您可以使用 Ant插件Flaka ,无需使用脚本语言=

You may use the Ant Plugin Flaka, no need to use a scripting language =

<project name="demo" xmlns:fl="antlib:it.haefelinger.flaka">
  <fl:install-property-handler />

    <property name="guid" value="a7655b5e-f074-4df1-9636-391aa234f4f4"/>

    <!-- simple echo -->
  <echo>
    #{'${guid}'.toupper}
   </echo>

    <!-- create new property for further processing -->
    <fl:let>
     guidtoupper := '#{'${guid}'.toupper}'
    </fl:let>

    <echo> $${guid} before => ${guid}</echo>

    <!-- overwrite existing property -->
  <fl:let>
   guid ::= '#{'${guid}'.toupper}'
  </fl:let>

    <echo> $${guid} after => ${guid}</echo>

</project>

输出:

 [echo]     A7655B5E-F074-4DF1-9636-391AA234F4F4
 [echo]    
 [echo]  ${guid} before => a7655b5e-f074-4df1-9636-391aa234f4f4
 [echo]  ${guid} after => A7655B5E-F074-4DF1-9636-391AA234F4F4

这篇关于如何在ant中将字符串转换为大写?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆