|
JAC project AOPSYS CEDRIC & LIP6 labs |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.objectweb.jac.util.Strings
Various often used string functions
Constructor Summary | |
Strings()
|
Method Summary | |
static String |
createPathString(Collection paths)
Create a path string, using the appropriate path separator |
static boolean |
equalsUSAsciiNoCase(String a,
String b)
Compares the USAscii representation of two strings in a case insensitive manner. |
static String |
getShortClassName(Class cl)
|
static String |
getShortClassName(String className)
|
static String |
hex(Object o)
Build a String representation of an object of the form <classname>@<hashcode> |
static boolean |
isEmpty(String str)
Tells if a string is empty (is null, has a zero length, or contains only whitespaces) |
static String |
join(Collection items,
String separator)
|
static String |
join(String[] items,
String separator)
|
static String |
newString(char c,
int length)
Build a string with a given length and all the characters equals. |
static String |
replace(String orgString,
String oldString,
String newString)
A useful method that replaces all the occurences of a string. |
static String |
slashify(String str)
The reverse of unslashify. |
static String[] |
split(String source,
String separator)
Split a string into an array |
static String[] |
splitPath(String paths)
Split a list of paths separated by path.separator |
static List |
splitToList(String source,
String separator)
Split a string into a list of strings |
static String |
toUSAscii(String s)
Replace accented chars with their non-accented value. |
static String |
trimWSAndCRLF(String str)
Removes all whitespace and CR/LF characters at the beginning or at the end of a string. |
static String |
unslashify(String str)
Replace slashed characters ("\t" -> '\t',"\r" -> '\t', "\n" -> '\n' ,"\f" -> '\f' , "\_" -> ' ') |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Strings()
Method Detail |
public static String unslashify(String str)
public static String slashify(String str)
public static String[] split(String source, String separator)
source
- string to splitseparator
- the separator
splitToList(String,String)
public static List splitToList(String source, String separator)
source
- string to splitseparator
- the separator
split(String,String)
public static String join(Collection items, String separator)
public static String join(String[] items, String separator)
public static String[] splitPath(String paths)
public static String createPathString(Collection paths)
paths
- a collection of File
public static String hex(Object o)
o
- the object to stringify
public static String newString(char c, int length)
c
- the character to fill the string withlength
- the length of the string
public static String replace(String orgString, String oldString, String newString)
orgString
- the original stringoldString
- the string to replace (if found) in the
original stringnewString
- the string that replaces all the occurences of
old string
public static String getShortClassName(Class cl)
public static String getShortClassName(String className)
public static String toUSAscii(String s)
s
- string to convertpublic static boolean equalsUSAsciiNoCase(String a, String b)
a
- first string to compareb
- second string to compare
public static boolean isEmpty(String str)
str
- string to test
public static String trimWSAndCRLF(String str)
str
- the string to trim
|
Contact JAC development team: Renaud Pawlak Lionel Seinturier Laurent Martelli |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |