public class StringFns extends Object
| Constructor and Description |
|---|
StringFns() |
| Modifier and Type | Method and Description |
|---|---|
static String |
cat(String s1,
String s2)
Concatenates two strings.
|
static String |
cat3(String s1,
String s2,
String s3)
Concatenates three strings.
|
static String |
cat4(String s1,
String s2,
String s3,
String s4)
Concatenates four strings.
|
static String |
cat5(String s1,
String s2,
String s3,
String s4,
String s5)
Concatenates four strings.
|
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(String s1, String s2)
public static String cat3(String s1, String s2, String s3)
public static String cat4(String s1, String s2, String s3, String s4)
public static String cat5(String s1, String s2, String s3, String s4, String s5)
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 © 2016. All rights reserved.