Java Utililty Methods Vector to String

List of utility methods to do Vector to String

Description

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

Method

StringconvertVectorToString(Vector source, String separator)
Convert the passed vector into a string with separators
if (source == null || separator == null) {
    return null;
StringBuffer sb = new StringBuffer("");
int si = source.size();
for (int i = 0; i < si; i++) {
    sb.append(source.elementAt(i).toString());
    if ((i + 1) < si) {
...
String[]convertVectorToStringArray(Vector vector)
Convert the passed vector into a string array
if (vector == null)
    return new String[0];
String[] arr = new String[vector.size()];
for (int i = 0; i < vector.size(); i++)
    arr[i] = vector.elementAt(i).toString();
return arr;
String[]toStringArray(Vector V)
to String Array
if ((V == null) || (V.size() == 0)) {
    final String[] s = new String[0];
    return s;
final String[] s = new String[V.size()];
for (int v = 0; v < V.size(); v++)
    s[v] = V.elementAt(v).toString();
return s;
...
Stringvector2string(AbstractList v, String sep)
vectorstring
if (v == null) {
    return null;
String s = "";
for (int i = 0; i < v.size(); i++) {
    s += (i > 0 ? sep : "") + v.get(i);
return s;
...
Stringvector2String(Vector v, String delimiter)
Serializing a Vector containing strings to a string using a given delimiter.
if (v == null || delimiter == null) {
    return null;
return enumeration2String(v.elements(), delimiter);
String[]vector_to_strings(Vector v)
Description of the Method
int len = v.size();
String[] ret = new String[len];
for (int i = 0; i < len; i++) {
    ret[i] = v.elementAt(i).toString();
return ret;
StringvectorString(Vector vec)

This method returns a string containing all the elements in vec concatenated together, comma separated.

if (vec == null) {
    return "";
StringBuffer temp = new StringBuffer();
for (int i = 0; i < vec.size(); i++) {
    if (i > 0) {
        temp.append(",");
    temp.append(vec.elementAt(i));
return temp.toString();
String[]vectorToNickNameArray(Vector nicksAndPaths)
vectorToNickNameArray
int i, j;
String line;
i = 0;
j = 0;
int sz = nicksAndPaths.size();
String[] result_buffer = new String[sz];
String temp;
while (i < sz) {
...
StringvectorToString(double[] v)
vector To String
return ("( " + v[0] + ", " + v[1] + ", " + v[2] + " )");
StringvectorToString(int[] v)
Creates and returns a formatted string representation of the input vector v
String str = "[";
for (int i = 0; i < v.length; i++)
    str += v[i] + ((i < v.length - 1) ? ", " : "");
return str + "]";