|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.su.utils.StrU
public class StrU
The String Utilities (StrU) help you to manipulate Strings, Lists and Arrays easier.
It does no error checking, so NPEs are possible. This allows the user to be
able to handle errors exactly as they want.
The methods should be access like StrU.methodName(args).
| Constructor Summary | |
|---|---|
StrU()
|
|
| Method Summary | |
|---|---|
static String |
concat(Object... args)
This creates a String from a series of Object arguments using the Object.toString() method. |
static String |
concat(String... args)
This is a convenience method. |
static String |
delim(char[] charArray)
Create a delimited String from an array of chars |
static String |
delim(char[] charArray,
String delim)
Create a delimited String from an array of chars |
static String |
delim(double[] doubleArray)
Create a delimited String from an array of doubles |
static String |
delim(double[] doubleArray,
String delim)
Create a delimited String from an array of doubles |
static String |
delim(float[] floatArray)
Create a delimited String from an array of floats |
static String |
delim(float[] floatArray,
String delim)
Create a delimited String from an array of floats |
static String |
delim(int[] intArray)
Create a delimited String from an array of ints |
static String |
delim(int[] intArray,
String delim)
Create a delimited String from an array of ints |
static String |
delim(List list)
Create a comma delimited String from a List of Objects |
static String |
delim(List list,
String delim)
Create a delimited String from a List of Objects |
static String |
delim(Object[] objArray)
Create a comma delimited String from an array of Objects |
static String |
delim(Object[] objArray,
String delim)
Create a delimited String from an array of Objects |
static void |
pr(Object... args)
This will print out the Objects(s) that you specify to System.out using the concat(Object...) method. |
static List<String> |
splitIntoList(String s,
String delim)
Splits String s into a List Object using the delimiter delim |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StrU()
| Method Detail |
|---|
public static List<String> splitIntoList(String s,
String delim)
s - the String to splitdelim - the delimiter to split the String on
String.split(String)
public static String delim(List list,
String delim)
list - the list of Objects;delim - the delimiter to place between Objects;
public static String delim(List list)
list - the list of Objects;
public static String delim(Object[] objArray)
objArray - the array to delimit
public static String delim(Object[] objArray,
String delim)
objArray - the array to delimitdelim - the delimiter
public static String delim(int[] intArray)
intArray - the array to delimit
public static String delim(int[] intArray,
String delim)
intArray - the array to delimitdelim - the delimiter
public static String delim(double[] doubleArray)
doubleArray - the array to delimit
public static String delim(double[] doubleArray,
String delim)
doubleArray - the array to delimitdelim - the delimiter
public static String delim(float[] floatArray)
floatArray - the array to delimit
public static String delim(float[] floatArray,
String delim)
floatArray - the array to delimitdelim - the delimiter
public static String delim(char[] charArray)
charArray - the array to delimit
public static String delim(char[] charArray,
String delim)
charArray - the array to delimitdelim - the delimiter
public static String concat(Object... args)
MessageFormat method.
String finalScoreMessage(int mine, in yours){
return StringUtils.concat("The final score is ", mine, " to ", yours, ".");
}
args - The Objects you wish to concatenate.
StringBuffer.append(String)public static String concat(String... args)
concat(Object...) except that it will only activate when
all arguments are already Strings. This makes it slightly more performant as it avoids the toString() method on
Objects.
args - String to concatenate
concat(Object...)public static void pr(Object... args)
concat(Object...) method.
args - the Objects to print.concat(Object...)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||