The powerful functions of FN functions in El expressions are simple, easy to use, and powerful.

Source: Internet
Author: User

 

It is very simple and powerful. The FN function in El expressions has powerful functions. For example, to calculate the size of a set in an object, you can directly use el expressions to calculate it ......

$ {Fn: length (clazze. Course )}

Export the package before using the FN function ......

<% @ Taglib prefix = "FN" uri = "http://java.sun.com/jsp/jstl/functions" %>



FN also has a wide range of usage:

Function Description Example
FN: Contains determine whether the string contains another string <C: If test = "$ {fn: Contains (name, searchstring)}">
FN: containsignorecase determine whether the string contains another string (case-insensitive) <C: If test = "$ {fn: containsignorecase (name, searchstring)}">
FN: endswith determine whether the string ends with another string <C: If test = "$ {fn: endswith (filename,". txt ")}">
FN: escapexml converts some characters into XML Representation. For example, <character should be converted to <$ {fn: escapexml (Param: INFO )}
Position where the FN: indexof substring appears in the parent string $ {fn: indexof (name ,"-")}
FN: Join combines the data in the array into a new string and uses the specified character lattice to open $ {fn: Join (array ,";")}
FN: length gets the length of the string, or the size of the array $ {fn: length (shoppingcart. Products )}
FN: replace Replace the specified character in the string $ {fn: Replace (text, "-", "& #149 ;")}
FN: Split the string according to the specified characters $ {fn: Split (customernames ,";")}
FN: startswith determine whether a string starts with a substring <C: If test = "$ {fn: startswith (product. ID," 100-")}">
FN: substring get substring $ {fn: substring (ZIP, 6,-1 )}
FN: substringafter obtains the substring starting from the position of a character.
$ {Fn: substringafter (ZIP ,"-")}
FN: substringbefore: Obtain the substring from the start to the position of a character $ {fn: substringbefore (ZIP ,"-")}
FN: Convert tolowercase to lower case $ {fn. tolowercase (product. Name )}
FN: Convert touppercase to uppercase characters $ {fn. uppercase (product. Name )}
FN: trim spaces before and after the trim string $ {fn. Trim (name )}

Function Description
 
FN: Contains (string, substring)
Returns true if the string parameter contains the substring parameter.
 
FN: containsignorecase (string, substring)
Returns true if the string parameter contains the substring (Case Insensitive ).
 
FN: endswith (string, suffix)
Returns true if string ends with suffix.
 
FN: escapexml (string)
Convert the XML (HTML) with special meaning to the corresponding XML character entity code, and return
 
FN: indexof (string, substring)
Returns the position where the substring parameter appears for the first time in the string parameter.
 
FN: Join (array, separator)
Concatenates a given array with a given delimiter separator to form a new string and return it.
 
FN: length (item)
Returns the number of elements contained in the parameter item. The parameter item type is array, collection, or string. For the string type, the return value is the number of characters in the string.
 
FN: Replace (string, before, after)
Returns a String object. Replace all places where the before parameter appears in the parameter string with the parameter after string, and return the replaced result.
 
FN: Split (string, separator)
Returns an array that uses the separator parameter as the delimiter to split the string parameter. Each part of the split is an element of the array.
 
FN: startswith (string, prefix)
Returns true if the string parameter starts with the prefix.
 
FN: substring (string, begin, end)
Returns the string part of the parameter, starting from the begin parameter to the end position of the parameter, including the character of the end position.
 
FN: substringafter (string, substring)
Returns the part of the substring that follows the string parameter.
 
FN: substringbefore (string, substring)
Returns the part of the substring before the string parameter.
 
FN: tolowercase (string)
Convert all characters of the string parameter to lowercase and return
 
FN: touppercase (string)
Converts all characters of the string parameter to uppercase and returns
 
FN: trim (string)
Remove the spaces at the beginning and end of the string parameter and return it.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.