ewe.util
Class mString

java.lang.Object
  extended byewe.util.mString

public class mString
extends Object

This provides many additional utility String manipulation routines.


Field Summary
static int Lowercase
           
static int Uppercase
           
 
Constructor Summary
mString()
           
 
Method Summary
static void changeCase(char[] chars, int toWhat)
           
static String changeCase(String what, int toWhat)
           
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 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.
static String[] splitCommand(String args, String prepend)
           
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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, toString
 

Field Detail

Uppercase

public static final int Uppercase
See Also:
Constant Field Values

Lowercase

public static final int Lowercase
See Also:
Constant Field Values
Constructor Detail

mString

public mString()
Method Detail

split

public 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. It returns the destination vector and will create a new one if the provided one is null.


split

public static String[] split(String what,
                             char separator)
Splits up a String using the specified separator and returns an array of sub Strings.


split

public static String[] split(String what)
This splits a String using '|' as the separator.


toBytes

public static void toBytes(String what,
                           byte[] dest,
                           int offset)

toBytes

public static void toBytes(String what,
                           byte[] dest,
                           int offset,
                           boolean ascii)

toAscii

public static byte[] toAscii(String what)

fromAscii

public static String fromAscii(byte[] bytes,
                               int start,
                               int length)

toBytes

public static byte[] toBytes(String what)

fromBytes

public static String fromBytes(byte[] bytes,
                               int offset,
                               int stringLength)

fromBytes

public static String fromBytes(byte[] bytes)

toString

public static String toString(Object what)

changeCase

public static void changeCase(char[] chars,
                              int toWhat)

changeCase

public static String changeCase(String what,
                                int toWhat)

compare

public static int compare(String one,
                          String two)

compare

public static int compare(String one,
                          String two,
                          boolean ignoreCase)

indexOf

public static int indexOf(String s,
                          char what)

leftOf

public static String leftOf(String s,
                            char c)
This returns the string to the left of the specified character (not including the character). If the character is not found then it will return the entire string.


rightOf

public static String rightOf(String s,
                             char c)
This returns the string to the right of the specified character (not including the character). If the character is not found then it will return an empty string.


removeTrailingSlash

public static String removeTrailingSlash(String s)
This removes a trailing "/" or "\" character.


splitCommand

public static String[] splitCommand(String args,
                                    String prepend)

copyInto

public 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.

Parameters:
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.

copyInto

public static void copyInto(String data,
                            char[] destination,
                            int destinationStart)
Copy the characters from the String into the destination in the most memory effecient way.

Parameters:
data - The string data.
destination - The destination character array.
destinationStart - The starting point in the destination array.