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.


<%@ taglib uri="" prefix="c" %>

<%@ taglib uri="" prefix="fn" %>



       <title>&lt;fn:Length&gt; In JSTL</title>



      <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>



        JSTL fn:length() Function

About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.C.A, MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.