This Function tests the Input String starts with the given suffix or not.
This Program is a demo of Function <fn:startsWith> in JSTL. This function use to test that the input string starts from the given suffix or not. As per condition then we declare the syntax library of JSTL that will allow to access the JSTL functioning. Then after we declare variable and the syntax of function that will be execute and present the output on the web browser. In the end we close all the html tags.
fn:endsWith.jsp
<%@ taglib uri=”http://java.sun.com/jsp/jstl/core” prefix=”c” %>
<%@ taglib uri=”http://java.sun.com/jsp/jstl/functions” prefix=”fn” %>
<html>
<head>
<title><fn:endsWith> In JSTL</title>
</head>
<body>
<c:set var=”str” value=”Welcome to the World of JSP”/>
<c:if test=”${fn:endsWith(str, ‘JSP’)}”>
<b><center><br /><p>String Ends with JSP<p>
</c:if>
</body>
</html>