用空格替换字母

Replace alphabets with spaces

我想打印 item.rate,但只有在 it.Currently 中有整数值时,它才会打印汇率,character.I 中的货币也想隐藏字符。

<td> ${item.rate} </td>

您应该可以使用 Freemarker 的 replace 功能。请参阅 https://freemarker.apache.org/docs/ref_builtins_string.html#ref_builtin_replace 以供参考。

我建议使用正则表达式来查找不是数字​​的所有内容。这应该看起来像:

${item.rate}?replace('\D', '', 'r')

Freemarker 的正则表达式语法参考在这里:https://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html