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

Jsp

|
Topic |
What is "fn:replace" tag of Function Tag Library?
|
|
Explanation |
|
"fn:replace" is a string function of JSP Standard Tag Library(JSTL). This function is used to replace a substring "before" with another substring "after" to give the resulting
string.
Syntax:
String:fn:replace(string,before,after)
In the above syntax the "string", "before", "after" are of data type "String".
Example:
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions"
prefix="fn" %>
<p><b>Example for "fn:replace"::</b></p>
${fn:replace("Myname is SAM",'SAM','PAM')}
Result
Example for "fn:replace"::
Myname is PAM
In the above example the substring "SAM" is replaced with the substring "PAM"
in the string "Myname is PAM".
|
|
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.
|
|
|
|