You are here:   HomeJava Server PagesJava Standard Tag Lib (JSTL)JSTL fn:split() Function

This function use to split a string into subset of an array.

  

This Function use to make splitting of string into array substring. This program shows the demo of this function. First we call the syntax library for JSTL Accessing. Then after in body section we declare the variable that contain the stored value and then after declare the function syntax that present the output while execution on the web browser. And in the last we close all the html tags.

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

  </head>

      <body>

         <center><h3>Example Of JSTL Split Function </h3></center>

         <c:set var="str" value="This-is-JSP-World" />

         <c:set var="splitstr" value="${fn:split(str,'-')}" />

         <c:set var="joinedstr" value="${fn:join(splitstr,' ')}" />

         <b><center><p>String Before split: ${str}</p>

         <b><center><p>String After split and join: ${joinedstr}</p>

      </body>

 </html>

        JSTL fn:split() Function





Subscribe To Free Daily Newsletter!

Get Free News Updates Delivered Directly To Your Inbox
About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.SC (Computer Science), MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular Computer Notes 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.



What's New and Popular





Search Content







Advance Courses



Basic Courses



Advertise with Us