JSTL fn:join() and fn:split() function

JSTL fn:join():

The JSTL fn:join() function concatenates the all array elements with a specified separator.
Syntax:

String join (String[] inputArray, String separator)

JSTL fn:split():

The JSTL fn:split() function splits the given string into an array of substrings based on the specified delimiter string.
Syntax:

String[] split(String givenString, String specifiedDelimiter)

Example:

test.jsp

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>


	
		fn:split and fn:join JSTL function example
	
	
		
		String before splitting: 


String after split and join operation:

web.xml


	
  
          test.jsp
  	


Output:

jsp example 58
 
Download this example.
 
Next Topic: JSTL fn:length() function with example.
Previous Topic: JSTL fn:indexOf() function with example.