使用jstl 操做字符串:spa
<!-- 标题,判断和截取字符串显示 --> <c:if test="${fn:indexOf(loanList[1], '**')!=-1}"> <span class="span1">${fn:replace(fn:substring(loanList[1],0,8) ,"*","") } </span> <span class="span2">${fn:replace(fn:substring( loanList[1],8, fn:length(loanList[1]) ),"*","") }</span> </c:if> <c:if test="${fn:indexOf(loanList[1], '**')==-1}"> <span class="span1">${loanList[1]}</span> </c:if>
参考地址:> http://blog.csdn.net/fmwind/article/details/39055547.net