String functions in JSF EL (JSF Expression Language)

Add JSTL functions namespace in Facelets XHTML:




Example 2:
<c:forEach items="${contacts}" var="contact">
   <c:if test="${not fn:containsIgnoreCase(contact, '')}">       
<p>Doesn't contain ''</p> </c:if> 
Other functions:
  • toUpperCase, toLowerCase: Changes the capitalization of a string
  • substring, substringBefore, substringAfter: Gets a subset of a string
  • trim: Trims white space from a string
  • replace: Replaces characters in a string
  • indexOf, startsWith, endsWith, contains, containsIgnoreCase: Checks whether a string contains another string
  • split: Splits a string into an array
  • join: Joins a collection into a string
  • escapeXml: Escapes XML characters in a string
  • length: Returns the number of items in a collection, or the number of characters in a string
See also:

Featured Post

Low-tech Tools Can Fight Land Corruption, Experts Say

Technological solutions to prevent land corruption require resources, but they do not have to be expensive, land rights experts said Tuesday...