This Function Use to Count the Length of String or number of Characters in a String.
In This program we just execute the implementation of <fn:length> as we declare the library syntax of JSTL. Then after in Body section we declare two variables that will contain the stored value. Both variable contain the string value in next step we use length function in the output on web browser it will precise the value of character as length of String.
fn:Length.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:Length> In JSTL</title>
</head>
<body>
<c:set var=”str1″ value=”Welcome To The World Of Java Server Pages.”/>
<c:set var=”str2″ value=”This is Example of JSTL Function.” />
<br /><center><b><p>Length of First String : ${fn:length(str1)}</p>
<b><center><p>Length of Second String : ${fn:length(str2)}</p>
</body>
</html>