EL表达式处理字符串 是否 包含 某字符串 截取 拆分...............
EL表达式处理字符串 是否 包含 某字符串 截取 拆分...............
<%@ taglib uri="/WEB-INF/taglib/c.tld" prefix="c"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> 两个标签
页面内容如下:
<c:if test="${fn:contains(record.name,'样例')==false}">
<%
if ((f != null && f.trim().equals("0"))&&name!=null&&!name.trim().equals("免费报告")) {
%><a
href="javascript:void(0);alert('很抱歉,您无权访问!如需访问请购买产品或联系管理员...');">
${record.name} </a>
<%
} else {
%>
<a
href="/tcreportAction.do?method=lookReportInfo&bid=${record.bid } ">${record.name}</a>
<%
}
%>
</c:if>
<c:if test="${fn:contains(record.name,'样例')}">
<a
href="/tcreportAction.do?method=lookReportInfo&bid=${record.bid } ">${record.name}</a>
</c:if>
${wjcd.lrsj}原来得到的是如2006-11-12 11:22:22.0
${fn:substring(wjcd.lrsj, 0, 16)}
使用functions函数来获取list的长度
${fn:length(list)}
- fn:contains(string, substring)
- 假如参数string中包含参数substring,返回true
- fn:containsIgnoreCase(string, substring)
- 假如参数string中包含参数substring(忽略大小写),返回true
- fn:endsWith(string, suffix)
- 假如参数 string 以参数suffix结尾,返回true
- fn:escapeXml(string)
- 将有非凡意义的XML (和HTML)转换为对应的XML character entity code,并返回
- fn:indexOf(string, substring)
- 返回参数substring在参数string中第一次出现的位置
- fn:join(array, separator)
- 将一个给定的数组array用给定的间隔符separator串在一起,组成一个新的字符串并返回。
- fn:length(item)
- 返回参数item中包含元素的数量。参数Item类型是数组、collection或者String。假如是String类型,返回值是String中的字符数。
- fn:replace(string, before, after)
- 返回一个String对象。用参数after字符串替换参数string中所有出现参数before字符串的地方,并返回替换后的结果
- fn:split(string, separator)
- 返回一个数组,以参数separator 为分割符分割参数string,分割后的每一部分就是数组的一个元素
- fn:startsWith(string, prefix)
- 假如参数string以参数prefix开头,返回true
- fn:substring(string, begin, end)
- 返回参数string部分字符串, 从参数begin开始到参数end位置,包括end位置的字符
- fn:substringAfter(string, substring)
- 返回参数substring在参数string中后面的那一部分字符串
- fn:substringBefore(string, substring)
- 返回参数substring在参数string中前面的那一部分字符串
- fn:toLowerCase(string)
- 将参数string所有的字符变为小写,并将其返回
- fn:toUpperCase(string)
- 将参数string所有的字符变为大写,并将其返回
- fn:trim(string)
- 去除参数string 首尾的空格,并将其返回
截取字符串!使用!
<c:if test="${fn:length(onebeans.info)<=100 }">${ onebeans.info }</c:if>
EL表达式处理字符串 是否 包含 某字符串 截取 拆分...............的更多相关文章
- 【功能代码】---3 JS判断字符串是否包含某个字符串
JS判断字符串是否包含某个字符串 var str ="abc"; if(str.indexOf("bc")>-1){ alert('str中包含bc字符串 ...
- mysql判断表里面一个逗号分隔的字符串是否包含单个字符串、查询结果用逗号分隔
1.mysql判断表里面一个逗号分隔的字符串是否包含单个字符串 : FIND_IN_SET select * from tablename where FIND_IN_SET(传的参数,匹配字段) 例 ...
- 如何在 JavaScript 中检查字符串是否包含子字符串?
如何在 JavaScript 中检查字符串是否包含子字符串? // var test4 = _.includes(string, substring); 该方法需要此文件 <script src ...
- 算法之暴力破解和kmp算法 判断A字符串是否包含B字符串
我们都知道java中有封装好的方法,用来比较A字符串是否包含B字符串 如下代码,contains,用法是 str1.contains(str2), 这个布尔型返回,存在返回true,不存在返回fals ...
- C/C++判断字符串是否包含某个字符串
C风格 #include <iostream> #include <string> #include <cstring> using namespace std; ...
- [转载]js javascript 判断字符串是否包含某字符串,String对象中查找子字符,indexOf
var Cts = "bblText"; if(Cts.indexOf("Text") > 0 ) { alert('Cts中包含Text字符串'); }
- el 表达式的比较和包含
相等( equal ) :eq 不相等( not equal ): ne / neq 大于( greater than ): gt 小于( less than ): lt 大于等于( great th ...
- js 判断字符串是否包含某字符串,String对象中查找子字符,indexOf
var Cts = "bblText"; if(Cts.indexOf("Text") > 0 ) { alert('Cts中包含Text字符 ...
- python判断字符串是否包含子字符串
python的string对象没有contains方法,不可以使用string.contains的方法判断是否包含子字符串,但是python有更简单的方法来替换contains函数 python的st ...
随机推荐
- YII学习第二十三天,accessRules用法
访问控制过滤器(Access Control Filter)访问控制过滤器是检查当前用户是否能执行访问的controller action的初步授权模式. 这种授权模式基于用户名,客户IP地址和访问类 ...
- Java Timer及TimerTarsk(摘自网络)
Java自带的java.util.Timer类,通过调度一个java.util.TimerTask任务. 这种方式可以让程序按照某一个频度执行,但不能指定时间运行.用的较少.任务的调用通过起的子线程进 ...
- ArrayList和LinkedList和Vector源码分析
ArrayList源码: private static final int DEFAULT_CAPACITY = 10;//默认长度 /** * Shared empty array instance ...
- F - 小晴天老师系列——苹果大丰收
F - 小晴天老师系列——苹果大丰收 Time Limit: 2000/1000MS (Java/Others) Memory Limit: 128000/64000KB (Java/Other ...
- .net dynamic动态加属性
class Test : System.Dynamic.DynamicObject { public override bool TryGetMember(System.Dynamic.GetMemb ...
- phabricator 搭建
os:debian7 Installation Guide :https://secure.phabricator.com/book/phabricator/ $ cd /data # 安装目录 da ...
- drupal7的node的内容的存储位置
标题是存在node表中的,但是实际内容存在表field_data_body中
- 为什么yslow用不了
因为yslow暂时不支持 Firefox 36以上版本.建议您可以使用它的书签版.访问这里 http://yslow.org/mobile/把页面最后的那个 Desktop Bookmarklet I ...
- 错误提示 Unsupported compiler 'com.apple.compilers.llvmgcc42' selected for architecture 'i386'
转自http://blog.csdn.net/cyuyanenen/article/details/51444974 警告提示:Invalid C/C++ compiler in target Cor ...
- js对象,类
js闭包网站:http://www.cnblogs.com/qieguo/p/5457040.html 有权访问另一个函数作用域内变量的函数都是闭包. 这里 inc 函数访问了构造函数 a 里面的变量 ...