JSTL常用函数
来源:互联网 发布:马航mh370失联真相知乎 编辑:程序博客网 时间:2024/06/05 07:58
<%@tablib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>${fn:substring("你要截取的字符串"),beginIndex,endIndex} 下面是JSTL中自带的方法列表以及其描述函数名 函数说明 使用举例 fn:contains 判断字符串是否包含另外一个字符串 <c:if test="${fn:contains(name, searchString)}"> fn:containsIgnoreCase 判断字符串是否包含另外一个字符串(大小写无关) <c:if test="${fn:containsIgnoreCase(name, searchString)}"> fn:endsWith 判断字符串是否以另外字符串结束 <c:if test="${fn:endsWith(filename, ".txt")}"> fn:escapeXml 把一些字符转成XML表示,例如<字符应该转为< ${fn:escapeXml(param:info)} fn:indexOf 子字符串在母字符串中出现的位置 ${fn:indexOf(name, "-")} fn:join 将数组中的数据联合成一个新字符串,并使用指定字符格开 ${fn:join(array, ";")} fn:length 获取字符串的长度,或者数组的大小 ${fn:length(shoppingCart.products)} fn:replace 替换字符串中指定的字符 ${fn:replace(text, "-", "•")} fn:split 把字符串按照指定字符切分 ${fn:split(customerNames, ";")} fn:startsWith 判断字符串是否以某个子串开始 <c:if test="${fn:startsWith(product.id, "100-")}"> fn:substring 获取子串 ${fn:substring(zip, 6, -1)} fn:substringAfter 获取从某个字符所在位置开始的子串 ${fn:substringAfter(zip, "-")} fn:substringBefore 获取从开始到某个字符所在位置的子串 ${fn:substringBefore(zip, "-")} fn:toLowerCase 转为小写 ${fn.toLowerCase(product.name)} fn:toUpperCase 转为大写字符 ${fn.UpperCase(product.name)} fn:trim 去除字符串前后的空格 ${fn.trim(name)}
阅读全文
0 0
- JSTL常用函数
- JSTL常用函数总结
- JSTL常用函数
- 常用的JSTL函数整理。
- JSTL常用函数(金额,日期格式化等)
- jstl 常用自带函数罗列
- jstl中常用的EL函数
- JSTL标签和常用函数的使用
- JSTL函数
- JSTL函数
- JSTL函数
- JSTL函数
- JSTL函数
- JSTL 函数
- jstl 函数
- jstl函数
- jstl函数
- jstl 函数
- 【NOIP2017提高A组模拟8.25】夜莺与玫瑰
- springboot + profile(不同环境读取不同配置)
- yum命令初级
- SpringAOP神秘面纱之动态代理
- HDU6180-Schedule
- JSTL常用函数
- ros nodehandle源码级深度分析(未完待续)
- jxls导入Excel(即读取Excel中的数据)
- Rstudio手动安装程序包
- cocos2d-x集成shareSDK一键分享
- UVALive3523 [Knights of the Round Table] tarjan求无向图双联通分量
- 地震之后
- 1108:成绩转换
- angular http