Package org.zkoss.xel.fn
Class StringFns
java.lang.Object
org.zkoss.xel.fn.StringFns
Functions to manipulate strings in EL.
- Author:
- tomyeh
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringConcatenates two objects.static StringConcatenates three objects.static StringConcatenates four objects.static StringConcatenates five objects.static StringEliminates single and double quotations to avoid JavaScript injection.static booleanTests if this string ends with the specified suffix.static StringJoins an array of string.static StringReplaces all occurrences of 'from' in 'src' with 'to'static String[]Splits a string.static booleanstartsWith(String s1, String s2) Tests if this string starts with the specified prefix.static StringReturns a new string that is a substring of this string.static StringConverts all of the characters in this String to upper case using the rules of the current Locale.static StringConverts all of the characters in this String to upper case using the rules of the current Locale.static StringReturns a copy of the string, with leading and trailing whitespace omitted.
-
Constructor Details
-
StringFns
public StringFns()
-
-
Method Details
-
cat
Concatenates two objects. Note: null is considered as empty. -
cat3
Concatenates three objects. Note: null is considered as empty. -
cat4
Concatenates four objects. Note: null is considered as empty. -
cat5
Concatenates five objects. Note: null is considered as empty. -
toLowerCase
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
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
Returns a copy of the string, with leading and trailing whitespace omitted.- Since:
- 5.0.7
-
split
Splits a string.- Since:
- 5.0.7
-
join
Joins an array of string. since 5.0.7 -
startsWith
Tests if this string starts with the specified prefix.- Since:
- 5.0.7
-
endsWith
Tests if this string ends with the specified suffix.- Since:
- 5.0.7
-
substring
Returns a new string that is a substring of this string.- Since:
- 5.0.7
-
replace
Replaces all occurrences of 'from' in 'src' with 'to' -
eatQuot
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
-