BeginnersBook

  • Home
  • Java
    • Java OOPs
    • Java Collections
    • Java Examples
  • C
    • C Examples
  • C++
    • C++ Examples
  • DBMS
  • Computer Network
  • Python
    • Python Examples
  • More…
    • jQuery
    • Kotlin
    • WordPress
    • SEO
    • JSON
    • JSP
    • JSTL
    • Servlet
    • MongoDB
    • XML
    • Perl

fn:toUpperCase() – JSTL Function

Last Updated: December 1, 2013 by Chaitanya Singh | Filed Under: JSTL

It is just opposite of fn:toLowerCase() function. It converts input string to a uppercase string. All the characters of input string gets replaced with corresponding uppercase characters. The string which needs to be changed is provided as an argument to the function and the converted string is being returned by the function. We can pass the string as a variable or simply hard-coding it during function call.

Syntax

String fn:toUpperCase(String input)

It returns the String after converting the input string to uppercase.

Example of fn:toUpperCase()

Here we are converting few strings to their uppercases using the function.

<%@ 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:toUpperCase() example</title>
</head>
<body>
  <c:set var="site" value="BeginnersBook.com"/>
  <c:set var="author" value="Chaitanya"/>
  Hi This is ${fn:toUpperCase(author)} from ${fn:toUpperCase(site)}.
</body>
</html>

Output:

The strings author and site got replaced with all uppercase alphabets.

fn-toUpperCase-example

Top Related Articles:

  1. fn:join() and fn:split() JSTL Functions
  2. fn:substring(), fn:substringAfter() & fn:substringBefore() Functions
  3. fn:toLowerCase() – JSTL Function
  4. JSTL <c:set> Core Tag
  5. JSTL <c:out> Core Tag

About the Author

I have 15 years of experience in the IT industry, working with renowned multinational corporations. Additionally, I have dedicated over a decade to teaching, allowing me to refine my skills in delivering information in a simple and easily understandable manner.

– Chaitanya

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

JSTL Core Tags

  • c:out
  • c:set
  • c:remove
  • c:if
  • c:choose
  • c:when
  • c:otherwise
  • c:catch
  • c:import
  • c:forEach
  • c:forTokens
  • c:param
  • c:url
  • c:redirect
JSTL Functions
  • fn:contains()
  • fn:containsIgnoreCase()
  • fn:indexOf()
  • fn:escapeXML()
  • fn:join() & fn:split()
  • fn:length()
  • fn:startsWith()
  • fn:endsWith()
  • fn:substring()
  • fn:substringAfter()
  • fn:substringBefore()
  • fn:trim()
  • fn:toUpperCase()
  • fn:toLowerCase()
  • fn:replace()

Copyright © 2012 – 2025 BeginnersBook . Privacy Policy . Sitemap