public class StringFns extends Object
| Constructor and Description |
|---|
StringFns() |
| Modifier and Type | Method and Description |
|---|---|
static String |
cat(Object o1,
Object o2)
Concatenates two objects.
|
static String |
cat3(Object o1,
Object o2,
Object o3)
Concatenates three objects.
|
static String |
cat4(Object o1,
Object o2,
Object o3,
Object o4)
Concatenates four objects.
|
static String |
cat5(Object o1,
Object o2,
Object o3,
Object o4,
Object o5)
Concatenates five objects.
|
static String |
eatQuot(String s)
Eliminates single and double quotations to avoid JavaScript
injection.
|
static boolean |
endsWith(String s1,
String s2)
Tests if this string ends with the specified suffix.
|
static String |
join(Object[] ss,
String separator)
Joins an array of string.
|
static String |
replace(String src,
String from,
String to)
Replaces all occurrences of 'from' in 'src' with 'to'
|
static String[] |
split(String s,
String separator)
Splits a string.
|
static boolean |
startsWith(String s1,
String s2)
Tests if this string starts with the specified prefix.
|
static String |
substring(String s,
int from,
int to)
Returns a new string that is a substring of this string.
|
static String |
toLowerCase(String s)
Converts all of the characters in this String to upper case using the rules of the current Locale.
|
static String |
toUpperCase(String s)
Converts all of the characters in this String to upper case using the rules of the current Locale.
|
static String |
trim(String s)
Returns a copy of the string, with leading and trailing whitespace omitted.
|
public static String cat(Object o1, Object o2)
public static String cat3(Object o1, Object o2, Object o3)
public static String cat4(Object o1, Object o2, Object o3, Object o4)
public static String cat5(Object o1, Object o2, Object o3, Object o4, Object o5)
public static String toLowerCase(String s)
Locales.getCurrent()public static String toUpperCase(String s)
Locales.getCurrent()public static String trim(String s)
public static boolean startsWith(String s1, String s2)
public static boolean endsWith(String s1, String s2)
public static String substring(String s, int from, int to)
public static String replace(String src, String from, String to)
public static String eatQuot(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 © 2018. All rights reserved.