YouTip LogoYouTip

Jstl Function Length

# fn:length() Function [![Image 3: JSP Standard Tag Library](#)JSP Standard Tag Library](#) The fn:length() function returns the length of a string or the number of elements in a collection. ### Syntax The syntax for the fn:length() function is as follows: ${fn:length(collection | string)} ### Example Demonstration The following example demonstrates the functionality of this function: Using JSTL Functions

String Length (1) : ${fn:length(string1)}

String Length (2) : ${fn:length(string2)}

The output is as follows: String Length (1) : 21String Length (2) : 22 * * JSP Standard Tag Library](#)
← Jstl Function ReplaceJstl Function Join β†’