fn:trim tag of Function Tag Library

What is "fn:trim" tag of Function Tag Library?

Explanation

"fn:trim" is a function of JSP Standard Tag Library(JSTL). This function is used to remove leading and trailing whitespaces, tabs, linefeed characters from a string.

Syntax:


String:fn:trim(string)

In the above syntax the "string" is of Data type "String".

Example :


<%@ taglib uri="http://java.sun.com/jsp/jstl/functions"
prefix="fn" %>
Trimmed string::"${fn:trim(' space')}"

Result


Trimmed string::"space"

In the above example we have removed the tab space characters before the string "space".

Ask Questions

Ask Question