JSTL取得字符串长度及截取字符串(FN函数)

来源:互联网 发布:vue js 折叠面板例子 编辑:程序博客网 时间:2024/05/16 14:54

首先要引入标签库

<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>

fn:length(item)

返回参数item中包含元素的数量。参数Item类型是数组、collection或者String。假如是String类型,返回值是String中的字符数。

fn:substring(string, begin, end)

返回参数string部分字符串, 从参数begin开始到参数end位置,包括end位置的字符

fn:substringAfter(string, substring)

返回参数substring在参数string中后面的那一部分字符串   


参考地址

http://blog.csdn.net/snihcel/article/details/7410561

http://blog.csdn.net/fmwind/article/details/39055547?readlog