JSTL fn:subString() function

The JSTL fn:subString() function returns a sub string of the input string from the start index to the last index-1. Syntax: String subString(String inputString, int startIndex, int lastIndex) 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" %>   <html> <head> <title>fn:substring JSTL function example</title> </head> <body> <c:set var="testString" value="Hello this is a … Read more

Categories JSP

JSTL fn:replace() function

The JSTL fn:replace() function returns the input string by replacing all occurrence of the specified string with the given string. Syntax: String replace(String inputString, String specifiedString, String givenString) 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" %>   <html> <head> <title>fn:replace JSTL function example</title> </head> <body> <c:set var="testString" value="Hello this is a … Read more

Categories JSP

JSTL fn:length() function

The JSTL fn:length() function is used to get the length of the object. It returns no. of characters in case of string input and no. of elements in case of collection. Syntax: int length(String inputString/Collection object) 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" %>   <html> <head> <title>fn:length JSTL function example</title> … Read more

Categories JSP

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" … Read more

Categories JSP

JSTL fn:indexOf() function

The JSTL fn:indexOf() function returns the start position of the specified string in the input string. It returns -1 if specified string not found in the input string. Syntax: int indexOf(String inputString, String specifiedString) 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" %>   <html> <head> <title>fn:indexOf JSTL function example</title> </head> <body> … Read more

Categories JSP

JSTL fn:escapeXml() function

The JSTL fn:escapeXml() function is used to escape the html, xml or any other tag which can be treated as xml markup. Syntax: String escapeXml(String giventring) 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" %>   <html> <head> <title>fn:escapeXml JSTL function example</title> </head> <body> <c:set var="testString" value="<h4>Hello this is a JSTL function … Read more

Categories JSP

JSTL fn:endsWith() function

The JSTL fn:endsWith() function is used to check whether the input string is ends with the specified string or not. It returns true if input string is ends with the specified string otherwise return false. Syntax: boolean endsWith(String inputString, String specifiedString) 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" %>   <html> … Read more

Categories JSP

JSTL fn:startsWith() function

The JSTL fn:startsWith() function is used to check whether the input string is starts with the specified string or not. It returns true if input string is starts with the specified string otherwise return false. Syntax: boolean startsWith(String inputString, String specifiedString) 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" %>   <html> … Read more

Categories JSP

JSTL fn:containsIgnoreCase() function

The JSTL fn:containsIgnoreCase() function is used to check whether the input string contains the specified string or not by ignoring the case i.e. it is case insensitive. It returns true if input string contains the specified string by ignoring the case otherwise return false. Syntax: boolean containsIgnoreCase(String inputString, String specifiedString) Example: test.jsp <%@ taglib uri="http://java.sun.com/jsp/jstl/core" … Read more

Categories JSP

JSTL fn:contains() function

The JSTL fn:contains() function is used to check whether the input string contains the specified string or not. It returns true if input string contains the specified string otherwise return false. It is case sensitive. Syntax: boolean contains(String inputString, String specifiedString) 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" %>   <html> … Read more

Categories JSP