usingfnmatch.jsp

来自「jsp动态网站开发与实例(第3版) 源码」· JSP 代码 · 共 25 行

JSP
25
字号
	<%@page contentType="text/html"%>
	<%@page pageEncoding="Ms950"%>
	<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
	<html>
	    <head><title>演示字符串比对</title></head>
	    <body>
	    字符串:The JSTL functions<br>
	    比对字符串:JSTL(fn:contains)-
	    ${fn:contains("The JSTL functions ","JSTL")}<br>
	    比对字符串:jstl(fn:contains)-
	    ${fn:contains("The JSTL functions ","jstl")}<br>
	    比对字符串:jstl(fn:containsIgnoreCase)-
	    ${fn:containsIgnoreCase("The JSTL functions ","jstl")}<br><br>
	    
	    以The为前缀开始(fn:startsWith):
	    ${fn:startsWith("The JSTL functions ","The")}<br>
	    以functions为字尾作结束(fn:endsWith):
	    ${fn:endsWith("The JSTL functions ","functions ")}<br><br>
	  
	    子字符串JSTL开始的索引值(fn:indexOf):
	    ${fn:indexOf("The JSTL functions ","JSTL")}<br>    
	    
	    </body>
	</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?