Open In App

JSTL fn:toUpperCase() Function

In JSTL, the fn:toUpperCase() function is used to transform all the characters in a specified string to uppercase. If the input string is in lowercase, then this function can convert all the characters into uppercase.

In this article, we will see the Syntax along with Parameters and detailed implementation of JSTL fn:toUpperCase() Function in terms of example.



Syntax of fn:toUpperCase() Function

${fn:toUpperCase(string)}

Where,

Example of fn:toUpperCase() Function

In this example, we will discuss the use of fn:toUpperCase() in a JSP page.






<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ 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>JSTL fn:toUpperCase() Example</title>
  </head>
  <body>
    <c:set var="inputString" value="GeeksforGeeks"/>
    <h3>Original String: ${inputString}</h3>
      
    <p>Uppercase String: ${fn:toUpperCase(inputString)}</p>
      
  </body>
</html>

Output:

Original String: GeeksforGeeks
Uppercase String: GEEKSFORGEEKS

Output Screen of fn:toUpperCase() Function:

Explanation of the above Program:

Article Tags :