This Function tests the Input String starts with the given prefix 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 prefix 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:startsWith.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:startsWith> In JSTL</title>
</head>
<body>
<c:set var=”str” value=”Java Server Pages known as JSP “/>
<c:if test=”${fn:startsWith(str, ‘Java’)}”>
<b><center><br /><p>String Starts with Java<p>
</c:if>
</body>
</html>