|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectfi.hut.tml.xsmiles.util.StringUtils
StringUtils.java Several utilities dealing with strings. Taken from freely available java tools at: http://industry.ebi.ac.uk/~senger/tools/
| Field Summary | |
static java.lang.String |
VERSION
Version and date of the last update. |
| Constructor Summary | |
StringUtils()
|
|
| Method Summary | |
static java.lang.String |
delete(java.lang.String string,
java.lang.String delete)
Delete all occurrences of substrings from a string. |
static java.lang.String |
join(java.lang.String[] stringList)
Make one string out of stringList by putting spaces between each element. |
static java.lang.String |
join(java.lang.String[] stringList,
java.lang.String delimiter)
Opposite of split; concatenates STRINGLIST using DELIMITER as the separator. |
static int |
numBeforeLocation(char CHAR,
java.lang.String str,
int loc)
number of occurrences of character CHAR before location loc in string str. |
static int[] |
positions(char CHAR,
java.lang.String str)
return list of positions of character CHAR inside string str. |
static java.lang.String |
removePositions(java.lang.String str,
int[] pos)
Opposit string. |
static java.lang.String |
removeWhites(java.lang.String str)
removes all whitespace and 'unprintables characters' from String str, and returns new one. |
static java.lang.String |
replace(java.lang.String string,
java.lang.String from,
java.lang.String to)
In string S, replace all occurrence of FROM by TO and return this string. |
static java.lang.String |
stripChar(char CHAR,
java.lang.String str)
remove occurrences of character CHAR from string STR. |
| 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 VERSION
| Constructor Detail |
public StringUtils()
| Method Detail |
public static java.lang.String stripChar(char CHAR,
java.lang.String str)
CHAR - The character to be removed.str - The string from which to remove them
public static int numBeforeLocation(char CHAR,
java.lang.String str,
int loc)
CHAR - character whose occurrences should be countedstr - the string in which to do thisloc - the offset in str at which to start.
public static int[] positions(char CHAR,
java.lang.String str)
CHAR - the character whose positions are soughtstr - the string in which to find them
public static java.lang.String removeWhites(java.lang.String str)
str - The string on which to operate
public static java.lang.String join(java.lang.String[] stringList,
java.lang.String delimiter)
stringList - The list of strings that will to be put togetherdelimiter - The string to put between the strings of stringList
public static java.lang.String join(java.lang.String[] stringList)
stringList - the list of strings that will be put together
join(String[],String)
public static java.lang.String replace(java.lang.String string,
java.lang.String from,
java.lang.String to)
string - The string in which the replacements will be madefrom - String that, when it occurs in string, will be replacedto - The replacement of from in string
public static java.lang.String delete(java.lang.String string,
java.lang.String delete)
string - The string from which substrings will be deleted.delete - The substrings that are to be deleted.
replace(String, String, String)
public static java.lang.String removePositions(java.lang.String str,
int[] pos)
str - stringpos - positions of chars to be removed (must be ordered from lowest to highest and position can occur only once)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||