日期:2014-05-18  浏览次数:21019 次

使用freemarker如何在截取字符串?
我使用freemarker+springMVC的框架,不知道在.ftl文件中如何截取指定长度的中文字符串,freemakert有自己的函数吗?   (还是需要使用其它的标签,如何使用标签)

------解决方案--------------------
<#if news.title?length lt 13 >
${news.title}
<#else>
${news.title[0..12]}...
</#if>