public final class Strings extends Object
Modifier and Type | Method and Description |
---|---|
static String |
abbreviate(String text,
int size)
Abbreviate the given text on the given size limit with ellipsis.
|
static String |
capitalize(String string)
Capitalize the given string, i.e.
|
static String |
concat(Object left,
Object right)
Concatenate the string representation of the given objects.
|
static String |
encodeURL(String string)
URL-encode the given string using UTF-8.
|
static String |
escapeJS(String string)
Escapes the given string according the JavaScript code rules.
|
static String |
prettyURL(String string)
URL-prettify the given string.
|
public static String abbreviate(String text, int size)
text
- The text to be abbreviated.size
- The size limit of the text.public static String concat(Object left, Object right)
null
, otherwise the new EL 2.2
#{bean.string1.concat(bean.string2)}
can just be used.left
- The left hand.right
- The right hand.public static String capitalize(String string)
string
- The string to be capitalized.public static String prettyURL(String string)
string
- The string to be prettified.public static String encodeURL(String string)
<f:param>
.string
- The string to be URL-encoded.UnsupportedOperationException
- When this platform does not support UTF-8.public static String escapeJS(String string)
string
- The string to be escaped according the JavaScript code rules.