fn:containsIgnoreCase tag of Function Tag Library

What is "fn:containsIgnoreCase" function of Tag Library?


"fn:containsIgnoreCase This function is used to check if the "string" contains the specified "subtsring" no matter the case of the string and substring. The function returns true if the substring is present and false if not.



In the above syntax the "string" and "substring" are of data type "string". It returns a boolean value.

Example :

<%@ taglib uri="http://java.sun.com/jsp/jstl/core"
prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions"
prefix="fn" %>
String "Hiox" contains "h"::
<c:out value="${fn:containsIgnoreCase(Hiox,h)}"/>
Result :

String "Hiox" contains "h":: true

In the above example we checked whether the string "Hiox" has the substring "h". Here the "h" is checked with an upper case "H" ignoring the case, it returns "true".

Ask Questions

Ask Question