JSTL fn:toLowerCase() function

The JSTL fn:toLowerCase() function returns the input string after converting the all characters of the string to lower case.
Syntax: String toLowerCase(String inputString)

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:toLowerCase JSTL function example</title>
 </head>
 <body>
  <c:set var="testString"
                  value="Hello this is a JSTL function example."/>
  Given String: <br/>
  <c:out value="${testString}" /><br/><br/>
  String after change case (lower):<br/>
  <c:out value="${fn:toLowerCase(testString)}" />
 </body>
</html>
web.xml
<web-app>
 
  <welcome-file-list>
          <welcome-file>test.jsp</welcome-file>
  </welcome-file-list> 
 
</web-app>

Output:


No comments: