Freemaker隐藏手机号和判断长度

 Freemaker隐藏手机号,用一个取巧的方法。

  <#if con.phone??>

       ${con.phone?substring(0,3)}xxxx${con.phone?substring(7)}

    </#if>

先去前三位,再去7位后面的数字

Freemaker判断长度

<#if con.phone??&&con.phone?length gt 8>

注意长度这个单词不能写错

原文地址:https://www.cnblogs.com/powangxu/p/10315232.html