使用 freemarker 将字符串中的最后 2 个字符大写?
我有一个自由标记变量 ${string}
,它可以是任意长度。我如何将最后 2 个字符大写? 谢谢
I have a freemarker variable, ${string}
which can be of any length. How would I capitalize just the last 2 characters?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 upper_case 内置 和 对字符串进行序列切片并编写FTL 函数如
然后 FTL 表达式
生成字符串
foobAR
。You can use the upper_case builtin and sequence slicing on strings and write a FTL function like
Then the FTL expression
produces the string
foobAR
.