El表達式截取字符串

${fn:substring(chapter.lessonPlan,0,fn:indexOf(chapter.lessonPlan, '.') )}


${fn:substringBefore(chapter.lessonPlan,'.')}

 

  1. fn:contains 判斷字符串是否包含另一個字符串 <c:if test="${fn:contains(name, searchString)}">  

  2. fn:containsIgnoreCase 判斷字符串是否包含另一個字符串(大小寫無關) <c:if test="${fn:containsIgnoreCase(name, searchString)}">  

  3. fn:endsWith 判斷字符串是否以另外字符串結束 <c:if test="${fn:endsWith(filename, ".txt")}">  

  4. fn:escapeXml 把一些字符轉成XML表示,例如<字符應該轉爲&lt; ${fn:escapeXml(param:info)}  

  5. fn:indexOf 子字符串在母字符串中出現的位置 ${fn:indexOf(name, "-")}  

  6. fn:join 將數組中的數據聯合成一個新字符串,並使用指定字符格開 ${fn:join(array, ";")}  

  7. fn:length 獲取字符串的長度,或者數組的大小 ${fn:length(shoppingCart.products)}  

  8. fn:replace 替換字符串中指定的字符 ${fn:replace(text, "-", "&#149;")}  

  9. fn:split 把字符串按照指定字符切分 ${fn:split(customerNames, ";")}  

  10. fn:startsWith 判斷字符串是否以某個子串開始 <c:if test="${fn:startsWith(product.id, "100-")}">  

  11. fn:substring 獲取子串 ${fn:substring(zip, 6, -1)}  

  12. fn:substringAfter 獲取從某個字符所在位置開始的子串

  13.  ${fn:substringAfter(zip, "-")}  

  14. fn:substringBefore 獲取從開始到某個字符所在位置的子串 ${fn:substringBefore(zip, "-")}  

  15. fn:toLowerCase 轉爲小寫 ${fn.toLowerCase(product.name)}  

  16. fn:toUpperCase 轉爲大寫字符 ${fn.UpperCase(product.name)}  

  17. fn:trim 去除字符串先後的空格 ${fn.trim(name)}  

相關文章
相關標籤/搜索