Jstl fn:substring () function code and usage-Returns a subset of the start and end indexes of a specified string.

Source: Internet
Author: User
Tags first string

  1. uri="http://java.sun.com/jsp/jstl/functions" prefix="FN" %>
  2. The above URI depends on your actual situation.
  3. ${fn:substring ("The string you want to intercept"), Beginindex,endindex}
  4. User reply: Can intercept, with the FN function:
  5. <%@ taglib prefix="FN" uri="Http://java.sun.com/jsp/jstl/functions" %>
  6. The following is a list of the methods that are in Jstl and their descriptions
  7. Function Name Function Description Use example
  8. Fn:contains determines whether a string contains another string <c:if Test="${fn:contains (name, searchstring)} ">
  9. Fn:containsignorecase determines whether a string contains another string (case-insensitive) <c:ifTest="${ Fn:containsignorecase (name, SearchString)} ">
  10. Fn:endswith determines whether the string ends with a different string <c:if Test="${fn:endswith (filename,". TXT ")}">
  11. Fn:escapexml convert some characters into XML representations, such as the < character should be converted to < ${fn:escapexml (Param:info)}
  12. The position of the fn:indexof substring in the parent string ${fn:indexof (name, "-")}
  13. Fn:join union the data in the array into a new string and uses the specified character format to open ${fn:join (array, ";")}
  14. Fn:length gets the length of the string, or the size of the array ${fn:length (shoppingcart.products)}
  15. Fn:replace replaces the character specified in the string ${fn:replace (text, "-", "?")}
  16. Fn:split the string according to the specified word segmentation ${fn:split (customernames, ";")}
  17. Fn:startswith determines whether the string starts with a substring <c:if Test= "${fn:startswith (product.id," ")}">
  18. Fn:substring Get substring ${fn:substring (zip, 6,-1)}
  19. Fn:substringafter gets the substring starting at the location of a character
  20. ${fn:substringafter (Zip, "-")}
  21. Fn:substringbefore Gets the substring ${fn:substringbefore (zip, "-") from the beginning to the location of a character}
  22. Fn:tolowercase converted to lowercase ${fn.tolowercase (product.name)}
  23. Fn:touppercase to uppercase characters ${FN. Uppercase (Product.name)}
  24. Fn:trim Remove the space before and after the string ${fn.trim (name)}
  25. Function
  26. Describe
  27. Fn:contains (string, substring)
  28. Returns true if the parameter string contains the parameter substring.
  29. Fn:containsignorecase (string, substring)
  30. Returns true if the parameter string contains the parameter substring (ignoring case)
  31. Fn:endswith (string, suffix)
  32. Returns true if the argument string ends with the argument suffix
  33. Fn:escapexml (String)
  34. Convert XML (and HTML) of extraordinary significance to the corresponding XML character entity code, and return
  35. Fn:indexof (string, substring)
  36. Returns the position of the first occurrence of the parameter substring in the parameter string
  37. Fn:join (array, separator)
  38. Separator a given array array together with the given spacer, forming a new string and returning it.
  39. Fn:length (item)
  40. Returns the number of elements contained in the parameter item. The parameter item type is an array, a collection, or a string. If it is of type string, the return value is the number of characters in string.
  41. Fn:replace (String, before, after)
  42. Returns a String object. Replaces all occurrences of a parameter before string in a parameter string with a parameter after string, and returns the replaced result
  43. Fn:split (string, separator)
  44. Returns an array that splits the argument string with the parameter separator, and each part of the split is an element of the array
  45. Fn:startswith (string, prefix)
  46. If the argument string starts with the argument prefix, returns true
  47. Fn:substring (string, begin, end)
  48. Returns the string part of the argument, starting with the argument begin to the end position of the argument, including the character of the end position
  49. Fn:substringafter (string, substring)
  50. Returns the part of the string that follows the parameter substring in the argument string
  51. Fn:substringbefore (string, substring)
  52. Returns the part of the string that precedes the argument substring in the argument string
  53. Fn:tolowercase (String)
  54. Converts all characters of the argument string to lowercase and returns it
  55. Fn:touppercase (String)
  56. Converts all characters of the argument string to uppercase and returns it
  57. Fn:trim (String)

    1. Strips the argument string from the end of the space and returns it
Examples of Use
<%@ taglib uri= "Http://java.sun.com/jsp/jstl/core" prefix= "C"%><%@ taglib uri= "http://java.sun.com/jsp/ Jstl/functions "                                                   prefix=" FN "%>

Jstl fn:substring () function code and usage-Returns a subset of the start and end indexes of a specified string.

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.