本文介绍了如何在ant中将字符串转换为大写?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
可能的重复:
蚂蚁字符串函数?
我正在修改 wxi 文件作为 wix 安装和更新 guid 的一部分.作为迂腐"警告设置的一部分,如果 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 Plugin 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中将字符串转换为大写?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!