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

Replace

fn:replace

Input String Substring Before Substring After Result
${s1} e * ${fn:replace(s1, "e", "*")}
${s2} - ${fn:replace(s2, "-", "•")}
${s2} two empty ${fn:replace(s2, "two", "")}
${s2} empty string one ${fn:replace(s2, "", "one")}
null one two  ${fn:replace(undefined, "one", "two")}