JSTL fn:subStringBefore() function

The JSTL fn:subStringBefore() function returns a sub string of the input string before a specified string.

Syntax:

Strung subStringBefore(String inputString, String specifiedString)

Example:

test.jsp

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


	
	 fn:substringBefore JSTL function example
	
	
	  
	  Given String: 


Substring before Hello:

web.xml


	
  
          test.jsp
  	


Output:

jsp example 63
 
Download this example.
 
Next Topic: JSTL fn:toLowerCase() function with example.
Previous Topic: JSTL fn:subStringAfter() function with example.