Java Utililty Methods Vector from String

List of utility methods to do Vector from String

Description

The list of methods to do Vector from String are organized into topic(s).

Method

VectorparseArgumentVector(String argStr)
parse Argument Vector
Vector result = new Vector();
StringBuffer argBuf = new StringBuffer();
boolean backSlash = false;
boolean matchSglQuote = false;
boolean matchDblQuote = false;
for (int cIdx = 0; cIdx < argStr.length(); ++cIdx) {
    char ch = argStr.charAt(cIdx);
    switch (ch) {
...
VectorreverseVector(final Vector src)
returns the reversed vector of the input vector
Vector<String> ret = new Vector<String>();
for (int i = src.size(); i > 0; i--) {
    ret.addElement((String) src.elementAt(i - 1));
return ret;
VectorreverseVector(Vector rc)
reverse Vector
Collections.reverse(rc);
return rc;
Vectorstring2Vector(String s, String delimiter)
Deserializing a string into a vector using a given delimiter to find single tokens.
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;
VectorstringArrayToVector(String[] array)
Put in a string array and get back a Vector!
if (array == null)
    return new Vector(0);
Vector vector = new Vector(array.length);
for (int i = 0; i < array.length; i++) {
    vector.addElement(array[i]);
return vector;
VectorstringToVector(String[] arr)
string To Vector
if (arr == null) {
    return null;
Vector a = new Vector();
for (int i = 0; i < arr.length; i++) {
    a.add(arr[i].trim());
return a;
...
VectorstringVector(String input, String sepChars)

This method takes a sepChars-separated string and converts it to a vector of fields.

Vector results = new Vector();
int index = 0;
int oldindex = 0;
String temp;
char inputAry[] = input.toCharArray();
while (index != -1) {
    for (; oldindex < input.length(); oldindex++) {
        if (sepChars.indexOf(inputAry[oldindex]) == -1) {
...
Vectorunique(Vector list)
unique
Vector<String> newList = new Vector<String>();
Iterator<String> iterator = list.iterator();
while (iterator.hasNext()) {
    String text = iterator.next();
    if (!newList.contains(text))
        newList.add(text);
return newList;
...
booleanvectorContainsIgnoreCaseFirstLetter(Vector v, String value)
vector Contains Ignore Case First Letter
for (int i = 0; i < v.size(); i++) {
    String s = (String) v.elementAt(i);
    if (equalsIgnoreCaseFirstLetter(s, value))
        return true;
return false;
VectorvectorString(String splitStr, String delim)
vector String
boolean tokeWasColon = false;
int i, count;
StringTokenizer toker;
Vector result = new Vector();
toker = new StringTokenizer(splitStr, delim, true);
count = toker.countTokens();
for (i = 0; i < count; ++i) {
    String toke;
...