int fn:indexOf(String sourceStr, String specialStr)其中,sourceStr 表示源字符串,specialStr 为指定的字符串。
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%> <!DOCTYPE html> <html> <head> <title>编程帮(www.lmcjl.com)</title> </head> <body> <c:set var="str" value="This is first String." /> first首次出现索引:${fn:indexOf(str, "first")} </body> </html>
first首次出现索引:8
本文链接:http://task.lmcjl.com/news/17039.html