added another utility method.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@5066 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
kohsuke committed 2007-10-01 23:47:42 +00:00
1 parent 42afc1fd02
commit 2dd8eb270b
1 file changed
+9 -2
+9 -2
View File
@@ -255,14 +255,21 @@ public class Util {
out.write(buf,0,len);
}
public static String[] tokenize(String s) {
StringTokenizer st = new StringTokenizer(s);
/**
* @since 1.145
*/
public static String[] tokenize(String s,String delimiter) {
StringTokenizer st = new StringTokenizer(s,delimiter);
String[] a = new String[st.countTokens()];
for (int i = 0; st.hasMoreTokens(); i++)
a[i] = st.nextToken();
return a;
}
public static String[] tokenize(String s) {
return tokenize(s," \t\n\r\f");
}
public static String[] mapToEnv(Map<String,String> m) {
String[] r = new String[m.size()];
int idx=0;