将值添加到序列中? [英] Add Values to a Sequence?
本文介绍了将值添加到序列中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经在模板中创建了一个FreeMarker 序列:>
I've created a FreeMarker sequence in my template:
<#assign x = ["red", 16, "blue", "cyan"]>
如何为序列添加其他值?
How do I add additional values to the sequence?
推荐答案
您必须通过串联x
和仅包含新元素的序列来创建新序列:
You have to create a new sequence by concatenating x
and a sequence containing only the new element:
<#assign x = x + [ "green" ] />
这篇关于将值添加到序列中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文