Class StringFns

java.lang.Object
org.zkoss.xel.fn.StringFns

public class StringFns extends Object
Functions to manipulate strings in EL.
Author:
tomyeh
  • Constructor Details

    • StringFns

      public StringFns()
  • Method Details

    • cat

      public static String cat(Object o1, Object o2)
      Concatenates two objects. Note: null is considered as empty.
    • cat3

      public static String cat3(Object o1, Object o2, Object o3)
      Concatenates three objects. Note: null is considered as empty.
    • cat4

      public static String cat4(Object o1, Object o2, Object o3, Object o4)
      Concatenates four objects. Note: null is considered as empty.
    • cat5

      public static String cat5(Object o1, Object o2, Object o3, Object o4, Object o5)
      Concatenates five objects. Note: null is considered as empty.
    • toLowerCase

      public static String toLowerCase(String s)
      Converts all of the characters in this String to upper case using the rules of the current Locale.
      Since:
      5.0.7
      See Also:
    • toUpperCase

      public static String toUpperCase(String s)
      Converts all of the characters in this String to upper case using the rules of the current Locale.
      Since:
      5.0.7
      See Also:
    • trim

      public static String trim(String s)
      Returns a copy of the string, with leading and trailing whitespace omitted.
      Since:
      5.0.7
    • split

      public static String[] split(String s, String separator)
      Splits a string.
      Since:
      5.0.7
    • join

      public static String join(Object[] ss, String separator)
      Joins an array of string. since 5.0.7
    • startsWith

      public static boolean startsWith(String s1, String s2)
      Tests if this string starts with the specified prefix.
      Since:
      5.0.7
    • endsWith

      public static boolean endsWith(String s1, String s2)
      Tests if this string ends with the specified suffix.
      Since:
      5.0.7
    • substring

      public static String substring(String s, int from, int to)
      Returns a new string that is a substring of this string.
      Since:
      5.0.7
    • replace

      public static String replace(String src, String from, String to)
      Replaces all occurrences of 'from' in 'src' with 'to'
    • eatQuot

      public static String eatQuot(String s)
      Eliminates single and double quotations to avoid JavaScript injection. It eliminates all quotations. In other words, the specified string shall NOT contain any quotations.

      It is used to avoid JavaScript injection. For example, in DSP or JSP pages, the following codes is better to escape with this method.

      Since:
      3.5.2