public class mString extends Object
Modifier and Type | Field and Description |
---|---|
static int |
Lowercase |
static int |
Uppercase |
Constructor and Description |
---|
mString() |
Modifier and Type | Method and Description |
---|---|
static void |
changeCase(char[] chars,
int toWhat) |
static String |
changeCase(String what,
int toWhat) |
static String[] |
checkSplit(String what,
String possibleSeparators)
Possibly split a String into a set of sub-strings if one of a set of separators
is used.
|
static int |
compare(String one,
String two) |
static int |
compare(String one,
String two,
boolean ignoreCase) |
static void |
copyInto(String data,
char[] destination,
int destinationStart)
Copy the characters from the String into the destination in the most
memory effecient way.
|
static void |
copyInto(String data,
int dataStart,
char[] destination,
int destinationStart,
int length)
Copy the characters from the String into the destination in the most
memory effecient way.
|
static String |
fromAscii(byte[] bytes,
int start,
int length) |
static String |
fromBytes(byte[] bytes) |
static String |
fromBytes(byte[] bytes,
int offset,
int stringLength) |
static int |
indexOf(String s,
char what) |
static String |
leftOf(String s,
char c)
This returns the string to the left of the specified character (not including the character).
|
static String |
localeFormat(LocaleFormatted lf,
Locale loc)
Format a LocaleFormatted to a String.
|
static String |
localeFormat(LocaleFormatted lf,
Object format,
Locale loc)
Format a LocaleFormatted to a String.
|
static void |
localeParse(LocaleFormatted lf,
Locale loc,
String formatted)
Parse a String to a LocaleFormatted Object.
|
static String |
removeTrailingSlash(String s)
This removes a trailing "/" or "\" character.
|
static String |
rightOf(String s,
char c)
This returns the string to the right of the specified character (not including the character).
|
static String[] |
split(String what)
This splits a String using '|' as the separator.
|
static String[] |
split(String what,
char separator)
Splits up a String using the specified separator and returns an
array of sub Strings.
|
static Vector |
split(String what,
char separator,
Vector dest)
Splits up a String using the specified separator and add the substrings
to the destination Vector after clearing the Vector.
|
static String[] |
splitCommand(String args,
boolean preserveQuotes)
Split command line arguments using spaces, but keeping together
words with spaces in them that are enclosed in quotes.
|
static byte[] |
toAscii(String what) |
static byte[] |
toBytes(String what) |
static void |
toBytes(String what,
byte[] dest,
int offset) |
static void |
toBytes(String what,
byte[] dest,
int offset,
boolean ascii) |
static String |
toString(Object what) |
static CharArray |
toString(Object what,
CharArray dest) |
static CharArray |
toString(Object data,
CharArray dest,
Locale loc)
Convert an Object to a String, formatted for the current locale.
|
static CharArray |
toString(Object data,
CharArray dest,
Object format,
Locale loc)
Convert an Object to a String, formatted for the current locale.
|
static String |
toString(Object data,
Locale loc)
Convert an Object to a String, formatted for the current locale.
|
public static final int Uppercase
public static final int Lowercase
public static Vector split(String what, char separator, Vector dest)
public static String[] split(String what, char separator)
public static String[] checkSplit(String what, String possibleSeparators)
what
- the String to possibly separate.possibleSeparators
- the list of possible separator characters.public static void toBytes(String what, byte[] dest, int offset)
public static void toBytes(String what, byte[] dest, int offset, boolean ascii)
public static byte[] toAscii(String what)
public static String fromAscii(byte[] bytes, int start, int length)
public static byte[] toBytes(String what)
public static String fromBytes(byte[] bytes, int offset, int stringLength)
public static String fromBytes(byte[] bytes)
public static void changeCase(char[] chars, int toWhat)
public static int indexOf(String s, char what)
public static String leftOf(String s, char c)
public static String rightOf(String s, char c)
public static String removeTrailingSlash(String s)
public static String[] splitCommand(String args, boolean preserveQuotes)
args
- the String to split.preserveQuotes
- if this is true then the quotes are preserved,
otherwise they are removed.public static void copyInto(String data, int dataStart, char[] destination, int destinationStart, int length)
data
- The string data.dataStart
- The starting character in the String.destination
- The destination character array.destinationStart
- The starting point in the destination array.length
- The number of characters to copy.public static void copyInto(String data, char[] destination, int destinationStart)
data
- The string data.destination
- The destination character array.destinationStart
- The starting point in the destination array.public static String toString(Object data, Locale loc)
data
- the data Object to convert to a String.loc
- the locale to use for formatting. If it is null, the default
Locale is used.public static CharArray toString(Object data, CharArray dest, Locale loc)
data
- the data Object to convert to a String.dest
- the destination CharArray. If it is null a new one is
created and returned.loc
- the locale to use for formatting. If it is null, the default
Locale is used.public static CharArray toString(Object data, CharArray dest, Object format, Locale loc)
data
- the data Object to convert to a String.dest
- the destination CharArray. If it is null a new one is
created and returned.loc
- the locale to use for formatting. If it is null, the default
Locale is used.format
- a format specifier - usually a String.public static String localeFormat(LocaleFormatted lf, Locale loc)
lf
- the LocaleFormatted object to format.loc
- the Locale to use for formatting.public static String localeFormat(LocaleFormatted lf, Object format, Locale loc)
lf
- the LocaleFormatted object to format.format
- a format specifier - usually a String.loc
- the Locale to use for formatting.public static void localeParse(LocaleFormatted lf, Locale loc, String formatted) throws ParseException
lf
- the LocaleFormatted object that will be parsing.loc
- the Locale that was used for formatting.ParseException
- on a parse error.