private Vector splitString(String s, char c, boolean trim) { // Accepts a String and a char delimiter, // Splits String into (sub)strings at all occurrences of delimiter, // Returns Vector of (sub)strings. // Note: if boolean argument is true then // leading and trailing white space is trimmed from (sub)strings. Vector v = new Vector(); String x = new String(); for(int i = 0; i < s.length(); i++) { if(s.charAt(i) == c) { if (trim) { x = x.trim(); } v.add(x); x = new String(); } else { x += s.charAt(i); } } if (trim) { x = x.trim(); } v.add(x); return v; }