private static String[] mySplit(String source, String delimiter) {
StringTokenizer st = new StringTokenizer(source, delimiter);
List list = new ArrayList();
while (st.hasMoreElements()) {
list.add(st.nextToken().trim());
}
return (String[])list.toArray(new String[0]);
}
private static String myReplaceAll(String source, String find, String replace) throws IllegalArgumentException {
if (replace == null) {
replace = "";
}
StringBuffer sb = new StringBuffer(source);
StringBuffer mod;
boolean bDone = false;
int prevIndex = 0, currIndex = 0, i = 0;
mod = new StringBuffer(source);
while (!bDone) {
if ((currIndex = mod.toString().indexOf(find, prevIndex)) != -1) {
sb = sb.replace(currIndex, currIndex + find.length(), replace);
mod = mod.replace(currIndex, currIndex + find.length(), replace);
prevIndex = currIndex + replace.length();
} else {
bDone = true;
}
}
return (sb.toString());
}
08-06
08-06