Servlet & JSP (21)

Source: Internet
Author: User

The functions tag library is a standard El function set defined in jstl. The functions defined in the functions tag library are basically functions that operate on strings. To use the functions tag library on the JSP page, use the taglib command to specify the referenced tag library. For example:

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

16 functions in the functions tag library.

FN: Contains label

Determines whether a string contains a specified substring. The syntax format is as follows:

 
FN: Contains (string, substring)-> Boolean

FN: containsignorecase tag

Determines whether a string contains a specified substring, regardless of the case. The syntax format is as follows:

 
FN: containsignorecase (string, substring)-> Boolean

FN: startswith tag

Determines whether a string starts with a specified prefix. The syntax format is as follows:

 
FN: startswith (string, prefix)-> Boolean

FN: endwith tag

Determines whether a string ends with a specified suffix. The syntax format is as follows:

 
FN: endwith (string, suffix)-> Boolean

FN: indexof tag

Searches for the specified substring in a string and returns the index position of the first character of the first matched string.

 
FN: indexof (string, substring)-> int

FN: Replace label

Replace a part of a string with another string, return the replacement, and return the replacement result. The syntax format is as follows:

 
FN: Replace (inputstring, beforesubstring, aftersubstring)-> string

FN: substring tag

Truncates a part of a string. The syntax format is as follows:

 
FN: substring (string, beginindex, endindex)-> string

FN: substringbefore tag

Returns the string before the substring in a string. The syntax format is as follows:

FN: substringbefore (string, substring)-> string

FN: substringafter tag

Returns the string after the specified substring. The syntax format is as follows:

 
FN: substringafter (string, substring)-> string

FN: spilt tag

Splits a string into a string array. The syntax format is as follows:

 
FN: spilt (string, delimiters)-> string

FN: Join label

Concatenates all elements in the array into a string. The syntax format is as follows:

 
FN: Join (array, separator)-> string

FN: tolowercase tag

Converts all characters in a string to lowercase. The syntax format is as follows:

 
FN: tolowercase (string)-> string

FN: touppercase tag

Converts all characters in a string to uppercase.

FN: touppercase (string)-> string

FN: trim tag

Removes the spaces before and after the string.

 
FN: trim (string)-> string

FN: escapexml label

Convert the character "<", ">", "&" in the string to the corresponding character reference or pre-defined object reference. The syntax format is as follows:

 
FN: escapexml (string)-> string

FN: length label

Returns the number of elements in a set or the number of characters in a string.

 
FN: length (input)-> int

Reprinted please indicate the source: http://blog.csdn.net/iAm333

Related Article

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.