YouTip LogoYouTip

Jstl Function Indexof

# fn:indexOf() Function [![Image 3: JSP Standard Tag Library](#)JSP Standard Tag Library](#) The fn:indexOf() function returns the position of a specified substring within a string. ### Syntax The syntax for the fn:indexOf() function is as follows: ${fn:indexOf(,)} ### Example The following example demonstrates the functionality of this function: Using JSTL Functions<c:set var="string2" value="This is second String."/>

Index (1) : ${fn:indexOf(string1, "first")}

Index (2) : ${fn:indexOf(string2, "second")}

The result is as follows: Index (1) : 8Index (2) : 13 * * JSP Standard Tag Library](#)
← Jstl Function JoinJstl Function Escapexml β†’