JSTL Functions

JSTL function tag library contains set of string manipulation functions that can be used with the JSP Expression Language.

Syntax of JSTL Functions Tag Library

<%@ taglib uri=”http://java.sun.com/jsp/jstl/functions “prefix=”fn” %>

JSTL Function Tags

  • <fn:contains()>: It is used to check whether string contains specified sub string or not.
  • <fn:containsIgnoreCase()>:It returns true if string contains specified substring ,ignores case and also returns true or false based on evaluation condition.
  • <fn:endsWith()>: It returns true if string ends with specified suffix.
  • <fn:escapeXml()>: It is used to escape XML markup characters. It takes only one parameter of type string.
  • <fn:indexOf()>: It returns index for the first occurrence of the specified sub string.
  • <fn:join()>: It is used to join all the elements contained in an array with the specified string.
  • <fn:length()>: It returns number of elements from an array or collection, characters from a string.
  • <fn:replace()> :It is used to replace a string with another string.
  • <fn:split()>: It returns array of string by separating the string with separator.
  • <fn:startsWith()>:It returns true if string starts with prefix.
  • <fn:endsWith()>: It returns true if string ends with prefix.
  • <fn:substring()>: It returns substring of string with begin index till the end index.
  • <fn:substringAfter()>:It returns subset of string after the substring.
  • <fn:substring()>: It returns subset of string before the specific substring.
  • <fn:toLowerCase()>:It returns all the characters of string to lower case.
  • <fn:toUpperCase()>: It returns all the characters of string to upper case.
  • <fn:trim()>: It is used to remove white spaces from the start and end of the string.

Previous Tutorial :  JSTL SQL sql:setDataSource Tag :: Next Tutorial : JSTL Function fn:substringAfter()

Leave a Reply

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

Pin It on Pinterest

Share This

Share this post with your friends!