freemarker中的split字符串分割(十六)

时间:2022-08-28 21:45:45

1、简易说明

     split分割:用来根据另外一个字符串的出现将原字符串分割成字符串序列

 

2、举例说明

1 <#--freemarker中的split字符串分割-->
2 <#list "张三三,李思思,,王强,柳树,诸葛正我"?split(",") as name>
3 "${name}"
4 </#list>
5
6 <#list "AhuAjiuAjkdsfAoionAjiuiAnujkkdfAkoijAmcjdhfjdfaAdhnfjdhfA"?split("A") as num>
7 "${num}"
8 </#list>

 

3、示例结果

 1 <span style="white-space:pre">    </span> "张三三"
2 "李思思"
3 ""
4 "王强"
5 "柳树"
6 "诸葛正我"
7
8 ""
9 "hu"
10 "jiu"
11 "jkdsf"
12 "oion"
13 "jiui"
14 "nujkkdf"
15 "koij"
16 "mcjdhfjdfa"
17 "dhnfjdhf"
18 ""