How to access elements of array after using string.split in Velocity?

前端 未结 4 1791
旧巷少年郎
旧巷少年郎 2020-12-20 18:15

I am using Velocity Templating Language and currently have:

#set ( $stringList = $string.split(\",\") )

which works fine and splits the str

4条回答
  •  清酒与你
    2020-12-20 18:55

    Its also possible to push elements into an array like this.

    #set ($matchingProducts = [])
    #set($bar = $matchingProducts.add($p))
    

提交回复
热议问题