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.


boolean containsIgnoreCase(String inputString, String specifiedString)



<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
		<title>fn:containsIgnoreCase JSTL function example</title>
		<c:set var="testString" 
                          value="Hello this is a JSTL function example."/>
		<c:if test="${fn:containsIgnoreCase(testString, 'JSTL')}">
		   <h4>String JSTL found in the test string.</h4>
		<c:if test="${fn:containsIgnoreCase(testString, 'jstl')}">
		   <h4>String jstl found in the test string.</h4>




jsp example 53
Download this example.
Next Topic: JSTL fn:startsWith() function with example.
Previous Topic: JSTL fn:contains() function with example.


Content Protection by DMCA.com
Please Share