破妄虚

导航

 

 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>

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

posted on 2019-01-24 16:31  破妄虚  阅读(170)  评论(0编辑  收藏  举报