1 package com.bull.eclipse.jonas.utils; 2 3 7 8 import java.util.ArrayList ; 9 import java.util.StringTokenizer ; 10 11 public class StringUtil { 12 13 17 public static String [] concat(String [] part1, String [] part2) { 18 String [] full = new String [part1.length + part2.length]; 19 System.arraycopy(part1, 0, full, 0, part1.length); 20 System.arraycopy(part2, 0, full, part1.length, part2.length); 21 return full; 22 } 23 24 27 public static String [] cutString(String str, String delim) { 28 ArrayList strings = new ArrayList (); 29 StringTokenizer tokenizer = new StringTokenizer (str, delim); 30 while (tokenizer.hasMoreTokens()) { 31 strings.add(tokenizer.nextToken()); 32 } 33 34 return (String [])strings.toArray(new String [0]); 35 } 36 37 } 38 | Popular Tags |