Here you can find the source of string2Vector(String s, String delimiter)
Parameter | Description |
---|---|
s | The string to deserialize |
delimiter | The delimiter to tell tokens apart |
s
@SuppressWarnings({ "unchecked", "rawtypes" }) public static Vector string2Vector(String s, String delimiter)
//package com.java2s; //License from project: LGPL import java.util.*; public class Main { /**//from www. ja v a 2s . c o m * Deserializing a string into a vector using a given delimiter to * find single tokens. * * @param s The string to deserialize * @param delimiter The delimiter to tell tokens apart * @return A vector of String as taken from <code>s</code> */ @SuppressWarnings({ "unchecked", "rawtypes" }) public static Vector string2Vector(String s, String delimiter) { if (s == null || delimiter == null) { return null; } Vector v = new Vector(); StringTokenizer st = new StringTokenizer(s, delimiter); while (st.hasMoreTokens()) { v.add(st.nextToken()); } return v; } }