Only the first 100 characters are displayed in the Java implementation intercept string! Use! <c:if test= "${fn:length (onebeans.info) >100}" >${Fn:substri

Source: Internet
Author: User

The blog post only shows the first 100 characters of the Java implementation intercept string! Use! <c:if test= "${fn:length (onebeans.info) >100}" >${Fn:substri

http://blog.csdn.net/tfy1332/article/details/22811835

2014-04-02 17:14 3406 People read comments (0) favorite reports

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

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

${WJCD.LRSJ} was originally obtained as 2006-11-12 11:22:22.0

${fn:substring (WJCD.LRSJ, 0, 16)}

Use the functions function to get the length of the list

${fn:length (List)}

  1. Fn:contains (string, substring)
  2. Returns true if the parameter string contains the parameter substring.
  3. Fn:containsignorecase (string, substring)
  4. Returns true if the parameter string contains the parameter substring (ignoring case)
  5. Fn:endswith (string, suffix)
  6. Returns true if the argument string ends with the argument suffix
  7. Fn:escapexml (String)
  8. Convert XML (and HTML) of extraordinary significance to the corresponding XML character entity code, and return
  9. Fn:indexof (string, substring)
  10. Returns the position of the first occurrence of the parameter substring in the parameter string
  11. Fn:join (array, separator)
  12. Separator a given array array together with the given spacer, forming a new string and returning it.
  13. Fn:length (item)
  14. 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.
  15. Fn:replace (String, before, after)
  16. 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
  17. Fn:split (string, separator)
  18. Returns an array that splits the argument string with the parameter separator, and each part of the split is an element of the array
  19. Fn:startswith (string, prefix)
  20. If the argument string starts with the argument prefix, returns true
  21. Fn:substring (string, begin, end)
  22. 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
  23. Fn:substringafter (string, substring)
  24. Returns the part of the string that follows the parameter substring in the argument string
  25. Fn:substringbefore (string, substring)
  26. Returns the part of the string that precedes the argument substring in the argument string
  27. Fn:tolowercase (String)
  28. Converts all characters of the argument string to lowercase and returns it
  29. Fn:touppercase (String)
  30. Converts all characters of the argument string to uppercase and returns it
  31. Fn:trim (String)
  32. Strips the argument string from the end of the space and returns it


Intercept the string! Use!

<c:if test= "${fn:length (onebeans.info) >100}" >${fn:substring (Onebeans.info, 0,100)} ...</c:if>
<c:if test= "${fn:length (onebeans.info) <=100}" >${Onebeans.info}</c:if>

Only the first 100 characters are displayed in the Java implementation intercept string! Use! <c:if test= "${fn:length (onebeans.info) >100}" >${Fn:substri

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.