public static String[] delimStr(String str, String delim) {
if (str == null || delim == null) {
return null;
}
StringTokenizer token = new StringTokenizer(str, delim);
String[] strings = new String[token.countTokens()];
for (int i = 0; i < strings.length; i++) {
strings[i] = token.nextToken();
}
return strings;
}