【发布时间】:2012-10-29 12:04:28
【问题描述】:
在 groovy 中我需要帮助
我在这样的文本文件中有一些字符串 #$commonTomcat620.max_threads$# 这些值我必须在运行时替换。
我使用了以下代码:
def str = "#\$commonTomcat620.max_threads\$#"
fileContents = fileContents.replaceAll("${str}","100");
这个 str 在值中打印为 #$commonTomcat620.max_threads$#。但不替换文件。我试过 withOut #$ 。这是工作。
谢谢。
【问题讨论】: