<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> JSTL Functions • Trim

Trim

fn:trim

Input String Result
${custId} (whithout trim)
${custId} (whith trim)
${s1} ${fn:trim(s1)}
    3 spaces before and after   
${fn:trim("    3 spaces before and after   ")}
null  ${fn:trim(undefined)}
empty string  ${fn:trim("")}