jsp页面截取字符串
2016-11-24 17:57
274 查看
jsp页面引入:
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
页面使用:
${fn:substring(<string>, <beginIndex>, <endIndex>)}
页面实例:
页面运行结果:
jstl的function使用:abcd
jstl标签库截取字符串参考标准:
http://www.runoob.com/jsp/jstl-function-substring.html
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
页面使用:
${fn:substring(<string>, <beginIndex>, <endIndex>)}
页面实例:
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>My JSP 'index.jsp' starting page</title> <meta http-equiv="pragma" content="no-cache"> <meta http-equiv="cache-control" content="no-cache"> <meta http-equiv="expires" content="0"> <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> <meta http-equiv="description" content="This is my page"> </head> <body> jstl的function使用:${fn:substring("abcdefg",0,4)} </body> </html>
页面运行结果:
jstl的function使用:abcd
jstl标签库截取字符串参考标准:
http://www.runoob.com/jsp/jstl-function-substring.html
相关文章推荐
- struts2 标签截取字符串 struts2-在jsp页面中控制只显示前n个字符
- struts2 标签截取字符串 struts2-在jsp页面中控制只显示前n个字符
- jsp页面中截取字符串
- struts2 标签截取字符串 struts2-在jsp页面中控制只显示前n个字符
- JSP页面使用JSTL的function标签库截取字符串及格式化时间
- jsp页面上截取字符串
- jsp页面截取字符串
- JSP页面截取字符串的长度
- Jsp页面截取字符串
- java与jsp页面的字符串拼接和拆分
- jsp页面如何获取中文字符串
- JSP字符串截取类..
- java截取带html标签的字符串,再把标签补全(保证页面显示效果)
- jsp页面中java脚本整型字符串自动转换问题
- jstl三目运算:前台页面截取字符串
- jsp截取字符串
- ASP.net:截取固定长度字符串显示在页面,多余部分显示为省略号
- java截取带html标签的字符串,再把标签补全(保证页面显示效果)
- 在jsp页面中格式化字符串类型的时间到指定的类型
- jsp中从页面获得String类型时间字符串,存入Oracle中Date类型字段方法