JSTL fn:startsWith() function

The JSTL fn:startsWith() function is used to check whether the input string is starts with the specified string or not. It returns true if input string is starts with the specified string otherwise return false.

Syntax:

boolean startsWith(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:startsWith JSTL function example
	
	
		

		
		   

String starts with Hello.

web.xml


	
  
          test.jsp
  	


Output:

jsp example 54
 
Download this example.
 
Next Topic: JSTL fn:endsWith() function with example.
Previous Topic: JSTL fn:containsIgnoreCase() function with example.