|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.amx.duet.tools.text.StringUtil
A utility class, which contains a variety of String manipulation routines.
Constructor Summary | |
StringUtil()
|
Method Summary | |
static int |
FindString(java.lang.String str,
java.lang.String pattern,
int start)
Searches through a string for a specified sequence of characters. |
static char |
GetBufferChar(ObjectRef rbuffer)
This function is used to remove characters from a buffer. |
static java.lang.String |
GetBufferString(ObjectRef rbuffer,
int count)
This function is used to remove characters from a buffer. |
static java.lang.String |
LeftString(java.lang.String str,
int count)
Retrieves a String containing the specified number of characters from the beginning of a string. |
static java.lang.String |
MidString(java.lang.String str,
int start,
int count)
Retrieves a String containing the specified number of characters starting at the specified location in the source string. |
static java.lang.String[] |
parse(java.lang.String data,
java.lang.String delim)
Returns an array of strings containing each parsed value |
static java.lang.String |
RemoveString(ObjectRef rStr,
int count)
This function is used to remove a number of characters from a string |
static java.lang.String |
RemoveString(ObjectRef rStr,
java.lang.String pattern)
Removes the first instance of the passed in pattern from the source string and manipulates the source string parameter to reflect the changes. |
static java.lang.String |
RemoveString(ObjectRef rStr,
java.lang.String pattern,
int start)
Removes the first instance of the passed in pattern from the source string starting from the offset value and manipulates the source string parameter to reflect the changes. |
static java.lang.String |
RemoveString(java.lang.String str,
int count)
This function is used to remove a number of characters from a string |
static java.lang.String |
RemoveString(java.lang.String str,
java.lang.String pattern)
Removes the first instance of the passed in pattern from the source string but does not change the source string in anyway. |
static java.lang.String |
RemoveString(java.lang.String str,
java.lang.String pattern,
int start)
Removes the first instance of the passed in pattern from the source string starting from the offset value but does not change the source string in anyway. |
static java.lang.String |
RemoveStringAll(java.lang.String str,
java.lang.String pattern)
Removes every instance of the passed in pattern from the string and returns the new string without any of the pattern data. |
static java.lang.String |
ReplaceString(java.lang.String str,
java.lang.String pattern,
java.lang.String replace)
Removes every instance of the passed in pattern from the string and replaces them with the replace pattern. |
static java.lang.String |
RightString(java.lang.String str,
int count)
Retrieves a String containing the specified number of characters from the end of a string. |
static java.lang.String |
toAsciiHexString(byte[] bArr)
Generates an ASCII hex string from the byte array passed in. |
static byte[] |
writeBytes(byte[] b,
int off,
int len)
Writes len bytes from the specified byte array starting at offset off to this byte array (Code that I just didn't want to throw away, but is already being done in other places. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public StringUtil()
Method Detail |
public static final java.lang.String[] parse(java.lang.String data, java.lang.String delim)
data
- data string to be parseddelim
- string delimiter to parse the data by
public static final java.lang.String ReplaceString(java.lang.String str, java.lang.String pattern, java.lang.String replace)
str
- String to be manipulatedpattern
- Pattern to remove from source stringreplace
- Pattern to replace removed pattern with
public static final java.lang.String RemoveStringAll(java.lang.String str, java.lang.String pattern)
str
- String to be manipulatedpattern
- Pattern to remove from source string
public static final java.lang.String RemoveString(java.lang.String str, java.lang.String pattern)
str
- Source string to be manipulatedpattern
- Pattern to remove from source string
public static final java.lang.String RemoveString(ObjectRef rStr, java.lang.String pattern)
rStr
- Must be of type String. ObjectRef containing the source string data
to be manipulated (value is passed by reference).
Create rStr with a valueOf(String) Example:
ObjectRef rStr = new ObjectRef("") or rStr.valueOf("")
pattern
- Pattern to remove from source string
public static final java.lang.String RemoveString(java.lang.String str, java.lang.String pattern, int start)
str
- Source string to be manipulatedpattern
- Pattern to remove from source stringstart
- offset value
public static final java.lang.String RemoveString(ObjectRef rStr, java.lang.String pattern, int start)
rStr
- Must be of type String. ObjectRef containing the source string data
to be manipulated (value is passed by reference).
Create rStr with a valueOf(String) Example:
ObjectRef rStr = new ObjectRef("") or rStr.valueOf("")
pattern
- Pattern to remove from source stringstart
- offset value
public static final java.lang.String RemoveString(ObjectRef rStr, int count)
rStr
- Must be of type String. ObjectRef containing the source string data
to be manipulated (value is passed by reference).
Create rStr with a valueOf(String) Example:
ObjectRef rStr = new ObjectRef("") or rStr.valueOf("")
count
- the number of characters to remove
public static final java.lang.String RemoveString(java.lang.String str, int count)
str
- Source string to be manipulatedcount
- the number of characters to remove
public static final byte[] writeBytes(byte[] b, int off, int len)
b
- source byte array containing all of the dataoff
- offset value to start copying source array fromlen
- number of bytes to copy after offset
public static final java.lang.String toAsciiHexString(byte[] bArr)
public static final java.lang.String GetBufferString(ObjectRef rbuffer, int count)
1. Retrieve the characters from the buffer up to the specified count.
2. Remove the retrieved characters from the buffer and shift the remaining characters up to fill the gap.
count
- the number of characters to be retrieved and then shifted
public static final char GetBufferChar(ObjectRef rbuffer)
1. Retrieve the first character in the buffer.
2. Remove the retrieved character from the buffer and shift the remaining characters by one to fill the gap.
public static final java.lang.String LeftString(java.lang.String str, int count)
str
- the string from which to extract the characters.count
- the number of character to copy from the beginning of the string.
public static final java.lang.String RightString(java.lang.String str, int count)
str
- the string from which to extract the characters.count
- the number of character to copy from the end of the string.
public static final java.lang.String MidString(java.lang.String str, int start, int count)
str
- the string from which to extract the characters.start
- the starting location in the string.count
- the number of characters to extract.
public static final int FindString(java.lang.String str, java.lang.String pattern, int start)
str
- the string of characters to search.pattern
- the sequence of characters to search forstart
- the starting character position for the search
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |