This Function use to join all the array elements into String.
This function <fn:join> will join the array elements into a string. First we call the syntax library for accessing the JSTL. Then we declare the variables for storing the value that contained by variable. After in the body section we declare the function syntax that will use to execute while compiling and will present the output on the web browser.
fn:Join.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:Join>In JSTL</title>
</head>
<body>
<c:set var=”str1″ value=”Java Server pages.”/>
<c:set var=”str2″ value=”${fn:split(str1, ‘ ‘)}” />
<c:set var=”str3″ value=”${fn:join(str2, ‘-‘)}” />
<br /><b><center><p>Real String : ${str3}</p>
</body>
</html>