|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbodhidharma.utilities.StringMethods
public class StringMethods
A holder class for static methods relating to manipulating strings.
String
Constructor Summary | |
---|---|
StringMethods()
|
Method Summary | |
---|---|
static java.lang.String |
convertFilePathToFileName(java.lang.String file_path)
Returns the name of the file referred to by the given path. |
static java.lang.String |
getBeginningOfString(java.lang.String string_to_shorten,
int number_characters)
Returns a copy of the given string with all but the first number_characters eliminated. |
static java.lang.String |
getBeginningOfStringWithHyphenFiller(java.lang.String string_to_shorten,
int number_characters)
Returns a copy of the given string with all but the first number_characters eliminated. |
static java.lang.String |
getDirectoryName(java.lang.String file_path)
Returns the name of the directory that the given filename is found in. |
static java.lang.String |
getExtension(java.lang.String filename)
Returns the three letter extension of the given file name. |
static int |
getIndexOfString(java.lang.String given_name,
java.lang.String[] possible_names)
Returns the index in the possible_names array where the given_name parameter occurs. |
static java.lang.String |
getRoundedDouble(double number_to_round,
int decimal_places)
Returns a formatted version of number_to_round. |
static java.lang.String |
giveStringXMLEscapeCharacters(java.lang.String data)
|
static java.lang.String |
removeExtension(java.lang.String filename)
Returns a copy of the given string with the last four characters removed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StringMethods()
Method Detail |
---|
public static java.lang.String convertFilePathToFileName(java.lang.String file_path)
file_path
- The file path from which the file name is to be extracted.
public static java.lang.String getDirectoryName(java.lang.String file_path) throws java.lang.Exception
java.lang.Exception
public static java.lang.String removeExtension(java.lang.String filename)
filename
- The name of the file from which the extension is to be removed.
public static java.lang.String getExtension(java.lang.String filename)
filename
- The name of the file from which the extension is to be returned.
public static java.lang.String getBeginningOfString(java.lang.String string_to_shorten, int number_characters)
string_to_shorten
- The string to be shortened or have spaces added to its end.number_characters
- Number of characters in the new string.
public static java.lang.String getBeginningOfStringWithHyphenFiller(java.lang.String string_to_shorten, int number_characters)
string_to_shorten
- The string to be shortened or have spaces added to its end.number_characters
- Number of characters in the new string.
public static java.lang.String getRoundedDouble(double number_to_round, int decimal_places)
Values of not a number, negative infinity and positive infinity will be returned as NaN, -Infinity and Infinity respectively.
number_to_round
- The number that is to be rounded.decimal_places
- The maximum number of decimal places that will be displayed.public static int getIndexOfString(java.lang.String given_name, java.lang.String[] possible_names) throws java.lang.Exception
given_name
- The string to search for in possible_names.possible_names
- The array to search for given_names in.
java.lang.Exception
public static java.lang.String giveStringXMLEscapeCharacters(java.lang.String data)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |