public class Text
extends java.lang.Object
| Constructor and Description |
|---|
Text() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String[] |
addString(java.lang.String[] array,
java.lang.String newString) |
static int |
atoi(java.lang.String number,
int defaultValue)
Convert a string to a number.
|
static java.lang.String |
doubleToMoneyString(double d)
This takes a double and formats it with ',' 1000s seperator and ensures
2 decimal places.
|
static boolean |
getBoolValue(java.lang.String value)
will try and determine if value is true of false.
|
static boolean |
isFalse(java.lang.String value)
Checks if the value is false.
|
static boolean |
isTrue(java.lang.String value)
Checks if the value is true.
|
static boolean |
isWhiteSpaceChar(char c)
skip over white space including ' ' 0x0a and 0x0d
|
static java.lang.String |
leftPad(java.lang.String value,
int length,
char padding)
Pad a string to left to make a full string of length.
|
java.lang.String |
leftPadZeros(java.lang.String value,
int length)
used to left pad the number we recieve - we must left pad them
as some are prefixed with zeros and some are not
|
static java.lang.String |
longToComma(long size)
Will convert a long to a string comma with a , seperator every 4th place.
|
static java.lang.String |
longToString(long size)
Will convert an int to a computer size in terms of Bytes(B), KBytes(K)
and MBytes(M)
|
static java.lang.String |
make2DigitNumber(int number)
Convert a number to a String with a minimum of 2 digits.
|
static java.lang.String |
makeNDigitNumber(int number,
int size)
Convert a number to a String with a mininum of size digits.
|
static double |
moneyToDouble(java.lang.String s)
This takes a money string and removes any ',' 1000s seperator and then
returns it as a double.
|
static java.lang.String |
moneyToDoubleString(java.lang.String d)
This takes a money string and removes any ',' 1000s seperator.
|
static java.lang.String |
remove(java.lang.String source,
char removeThis)
Remove all characters matching 'removeThis' from the source String.
|
static java.lang.String[] |
removeString(java.lang.String[] array,
int index) |
static java.lang.String |
stripAndPadDecimal(java.lang.String value) |
static java.lang.String |
trim(java.lang.String src)
Trim a String.
|
public static java.lang.String make2DigitNumber(int number)
1 = '01' & 10 = '10' & 100 = '100'number - public static java.lang.String makeNDigitNumber(int number,
int size)
if size = 2 and number = 20 return ("20")
if size = 4 and number = 20 return ("0020")
if size = 8 and number = 200 return ("00000200")
if size = 2 and number = 200 return ("200")
number - is the integer number we want converted to a stringsize - is the amount of digets we want in the number.public static java.lang.String longToString(long size)
public static java.lang.String longToComma(long size)
public java.lang.String leftPadZeros(java.lang.String value,
int length)
value - length - public static java.lang.String leftPad(java.lang.String value,
int length,
char padding)
value - length - padding - is the character we want to pad with.public static java.lang.String stripAndPadDecimal(java.lang.String value)
public static int atoi(java.lang.String number,
int defaultValue)
number - is the number in string formatdefaultValue - is returned if an exception is thrownpublic static java.lang.String[] addString(java.lang.String[] array,
java.lang.String newString)
public static java.lang.String[] removeString(java.lang.String[] array,
int index)
public static java.lang.String remove(java.lang.String source,
char removeThis)
source - is the source StringremoveThis - is the character we want removed from the source. Remember
all instance of the character 'removeThis' are removed.public static boolean isTrue(java.lang.String value)
value - is the string to check for a true of false.public static boolean isFalse(java.lang.String value)
value - is the string to check for a true of false.public static boolean getBoolValue(java.lang.String value)
public static java.lang.String doubleToMoneyString(double d)
public static java.lang.String moneyToDoubleString(java.lang.String d)
public static double moneyToDouble(java.lang.String s)
public static java.lang.String trim(java.lang.String src)
src - - the String to trim, may be null.public static boolean isWhiteSpaceChar(char c)