public class StringFns
extends java.lang.Object
Constructor and Description |
---|
StringFns() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
cat(java.lang.Object o1,
java.lang.Object o2)
Concatenates two objects.
|
static java.lang.String |
cat3(java.lang.Object o1,
java.lang.Object o2,
java.lang.Object o3)
Concatenates three objects.
|
static java.lang.String |
cat4(java.lang.Object o1,
java.lang.Object o2,
java.lang.Object o3,
java.lang.Object o4)
Concatenates four objects.
|
static java.lang.String |
cat5(java.lang.Object o1,
java.lang.Object o2,
java.lang.Object o3,
java.lang.Object o4,
java.lang.Object o5)
Concatenates five objects.
|
static java.lang.String |
eatQuot(java.lang.String s)
Eliminates single and double quotations to avoid JavaScript
injection.
|
static boolean |
endsWith(java.lang.String s1,
java.lang.String s2)
Tests if this string ends with the specified suffix.
|
static java.lang.String |
join(java.lang.Object[] ss,
java.lang.String separator)
Joins an array of string.
|
static java.lang.String |
replace(java.lang.String src,
java.lang.String from,
java.lang.String to)
Replaces all occurrences of 'from' in 'src' with 'to'
|
static java.lang.String[] |
split(java.lang.String s,
java.lang.String separator)
Splits a string.
|
static boolean |
startsWith(java.lang.String s1,
java.lang.String s2)
Tests if this string starts with the specified prefix.
|
static java.lang.String |
substring(java.lang.String s,
int from,
int to)
Returns a new string that is a substring of this string.
|
static java.lang.String |
toLowerCase(java.lang.String s)
Converts all of the characters in this String to upper case using the rules of the current Locale.
|
static java.lang.String |
toUpperCase(java.lang.String s)
Converts all of the characters in this String to upper case using the rules of the current Locale.
|
static java.lang.String |
trim(java.lang.String s)
Returns a copy of the string, with leading and trailing whitespace omitted.
|
public static java.lang.String cat(java.lang.Object o1, java.lang.Object o2)
public static java.lang.String cat3(java.lang.Object o1, java.lang.Object o2, java.lang.Object o3)
public static java.lang.String cat4(java.lang.Object o1, java.lang.Object o2, java.lang.Object o3, java.lang.Object o4)
public static java.lang.String cat5(java.lang.Object o1, java.lang.Object o2, java.lang.Object o3, java.lang.Object o4, java.lang.Object o5)
public static java.lang.String toLowerCase(java.lang.String s)
Locales.getCurrent()
public static java.lang.String toUpperCase(java.lang.String s)
Locales.getCurrent()
public static java.lang.String trim(java.lang.String s)
public static java.lang.String[] split(java.lang.String s, java.lang.String separator)
public static java.lang.String join(java.lang.Object[] ss, java.lang.String separator)
public static boolean startsWith(java.lang.String s1, java.lang.String s2)
public static boolean endsWith(java.lang.String s1, java.lang.String s2)
public static java.lang.String substring(java.lang.String s, int from, int to)
public static java.lang.String replace(java.lang.String src, java.lang.String from, java.lang.String to)
public static java.lang.String eatQuot(java.lang.String s)
It is used to avoid JavaScript injection.
For example, in DSP or JSP pages, the following codes is better
to escape with this method.
Copyright © 2005-2021 Potix Corporation. All Rights Reserved.