This Function returns the subset of Substring.

This program is a demo that how to execute the <fn:substring> in JSTL. First instance we call the syntax library for accessing the JSTL properly. This Function will return the subset value of a string. Here we declare variable for containing the value in as per condition then after we declare the syntax of function that will represent the output on a web browser so on at the end we close all the custom tags

fn:substring.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>&lt;fn:substring&gt; In JSTL</title>

 </head>

  <body>

         <center><h3>Example of Substring In JSTL</h3></center>

         <br /><b><center><c:out value="${fn:substring('Java Server Pages',7,10)}"></c:out>

  </body>

</html>  

       JSTL fn:substring() Function



About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.SC (Computer Science), 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.



Search Content