|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.cc.framework.util.StringHelp
Helper class for string operations.
Field Summary | |
static java.lang.String |
CRLF
Code for carriage return |
Constructor Summary | |
private |
StringHelp()
Constructor |
Method Summary | |
static java.lang.String |
expand(java.lang.String str,
java.util.Map macros)
This method expands the markups (Format %macro%) in a string by the specified macros. |
static java.lang.String |
fill(java.lang.Object obj,
int fillLength,
char fillChar)
Fills a String with the specified pattern till the specified length. |
static boolean |
isWhitespaceOnlyStr(java.lang.String str)
Checks if a String contains only Whitespace characters |
static java.lang.String |
join(java.util.Collection tokens,
char delimiter)
Joins an array and inserts the specified delimiter between the array elements. |
static java.lang.String |
join(java.util.Collection tokens,
java.lang.String delimiter)
Joins an array and inserts the specified delimiter between the array elements. |
static java.lang.String |
join(java.lang.Object[] tokens,
char delimiter)
Joins an array and inserts the specified delimiter between the array elements. |
static java.lang.String |
join(java.lang.String token,
int repeat,
char delimiter)
Joins on token. |
static java.lang.String |
join(java.lang.String t1,
java.lang.String t2,
char delimiter)
Joins two strings and inserts the specified delimiter between the string. |
static java.lang.String |
join(java.lang.String t1,
java.lang.String t2,
java.lang.String t3,
char delimiter)
Joins three strings and inserts the specified delimiter between the string. |
static java.lang.String |
join(java.lang.String t1,
java.lang.String t2,
java.lang.String t3,
java.lang.String t4,
char delimiter)
Joins four strings and inserts the specified delimiter between the string. |
static boolean |
safeequals(java.lang.Object o1,
java.lang.Object o2)
Method safe equals |
static java.lang.String |
safetrim(java.lang.String str)
Removes white spaces at the end of a string. |
static java.lang.String[] |
split(java.lang.String text,
java.lang.String delimiter)
Splits the provided text into a list, based on a given separator. |
static java.lang.String[] |
splitRetainEmpty(java.lang.String text,
char delimiter)
Splits the provided text into a list, based on a given separator. |
static java.lang.String |
strcat(java.util.List tokens)
Concatenates an array of Objects. |
static java.lang.String |
strcat(java.lang.String[] tokens)
Concatenates an array. |
static java.lang.String |
strcat(java.lang.String t1,
java.lang.String t2)
Concatenates two strings |
static java.lang.String |
strcat(java.lang.String t1,
java.lang.String t2,
java.lang.String t3)
Concatenates three strings |
static java.lang.String |
strcat(java.lang.String t1,
java.lang.String t2,
java.lang.String t3,
java.lang.String t4)
Concatenates four strings |
static java.lang.String |
strcat(java.lang.String t1,
java.lang.String t2,
java.lang.String t3,
java.lang.String t4,
java.lang.String t5)
Concatenates four strings |
static java.lang.String[] |
toStringArray(java.lang.Object value)
Transforms an object into a String Array |
static java.util.Set |
toStringSet(java.lang.Object[] values)
Transforms an object into a String Set |
static java.lang.String |
trimRight(java.lang.String str)
Trims a String |
static java.lang.String |
truncate(java.lang.String str,
int maxlength)
Truncates a given string to a maximum number of characters |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String CRLF
Constructor Detail |
private StringHelp()
Method Detail |
public static boolean isWhitespaceOnlyStr(java.lang.String str)
str
- String to test
if the string contains only
whitespace Characters
public static java.lang.String[] toStringArray(java.lang.Object value)
value
- Object
public static java.util.Set toStringSet(java.lang.Object[] values)
values
- String Array
public static java.lang.String truncate(java.lang.String str, int maxlength)
str
- The string to truncatemaxlength
- The maximum number of characters
public static java.lang.String fill(java.lang.Object obj, int fillLength, char fillChar)
obj
- StringfillLength
- lengthfillChar
- pattern
public static java.lang.String safetrim(java.lang.String str)
str
- String
public static java.lang.String trimRight(java.lang.String str)
str
- String to trim
public static boolean safeequals(java.lang.Object o1, java.lang.Object o2)
o1
- Object1o2
- Object2
public static java.lang.String[] split(java.lang.String text, java.lang.String delimiter)
text
- The string to parsedelimiter
- The delimiter character. If null
, splits on
whitespace.
public static java.lang.String[] splitRetainEmpty(java.lang.String text, char delimiter)
text
- The string to parsedelimiter
- The delimiter character. If null
, splits on
whitespace.
public static java.lang.String join(java.lang.Object[] tokens, char delimiter)
tokens
- The tokens to joindelimiter
- The delimiter to insert between the tokens
public static java.lang.String join(java.lang.String token, int repeat, char delimiter)
token
- The token to joinrepeat
- The repeat countdelimiter
- The delimiter to insert between the tokens
public static java.lang.String join(java.util.Collection tokens, java.lang.String delimiter)
tokens
- The tokens to joindelimiter
- The delimiter to insert between the tokens
public static java.lang.String join(java.util.Collection tokens, char delimiter)
tokens
- The tokens to joindelimiter
- The delimiter to insert between the tokens
public static java.lang.String join(java.lang.String t1, java.lang.String t2, char delimiter)
t1
- String1t2
- String2delimiter
- The delimiter to used
public static java.lang.String join(java.lang.String t1, java.lang.String t2, java.lang.String t3, char delimiter)
t1
- String1t2
- String2t3
- String3delimiter
- The delimiter to used
public static java.lang.String join(java.lang.String t1, java.lang.String t2, java.lang.String t3, java.lang.String t4, char delimiter)
t1
- String1t2
- String2t3
- String3t4
- String4delimiter
- The delimiter to used
public static java.lang.String strcat(java.lang.String[] tokens)
tokens
- The tokens to join
public static java.lang.String strcat(java.util.List tokens)
tokens
- The tokens to join
public static java.lang.String strcat(java.lang.String t1, java.lang.String t2)
t1
- String1t2
- String2
public static java.lang.String strcat(java.lang.String t1, java.lang.String t2, java.lang.String t3)
t1
- String1t2
- String2t3
- String3
public static java.lang.String strcat(java.lang.String t1, java.lang.String t2, java.lang.String t3, java.lang.String t4)
t1
- String1t2
- String2t3
- String3t4
- String4
public static java.lang.String strcat(java.lang.String t1, java.lang.String t2, java.lang.String t3, java.lang.String t4, java.lang.String t5)
t1
- String1t2
- String2t3
- String3t4
- String4t5
- String5
public static java.lang.String expand(java.lang.String str, java.util.Map macros)
str
- String to expandmacros
- Map with macros
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |