|
|
fn:join tag of Function Tag Library
|
Tutorials

Jsp

|
Topic |
What is "fn:join" tag of Function Tag Library?
|
|
Explanation |
|
"fn:join" is a string function of JSP Standard Tag Library(JSTL). This function is used to return string with all the elements of an array seperated by a "seperator".
Syntax:
String:fn:join(array,seperator)
In the above syntax the "array" is an array, "seperator" is of data type "String".
Example:
<%@ taglib uri="http://java.sun.com/jsp/jstl/core"
prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions"
prefix="fn" %>
<c:set var="str" value="j o i n"/>
<p><b>The string array "join" using "|"::</b></p>
<c:set var="jnd" value="${fn:split(str,' ')}" />
<c:out value="${fn:join(jnd,'|')}" />
Result:
The string array "join" using "|"::
j|o|i|n
In the above example we have used the string "j o i n". All the elements of the string is split and
stored in an array "jnd" like {"j" "o" "i" "n"}. This array is displayed as string seperated by "|".
|
|
A Note |
|
JSP(Java Server Pages) is one of the most used Server Side Programming Language in the world. Simple introduction, basic program codes with examples. Begin coding your own JSP scripts with this online tutorial. Hope you enjoy this tutorial. Do send your feedback or suggestions on this JavaServer Pages tutorial. This is a copyright content.
|
|
|
|