Vector to String Array

Hello all...How can i convert a vector to a string array?
[71 byte] By [McPheea] at [2007-11-26 21:46:47]
# 1
Using the Vector.toArray() method (assuming that your vector contains Strings)? http://java.sun.com/j2se/1.3/docs/api/java/util/Vector.html
kevjavaa at 2007-7-10 3:36:36 > top of Java-index,Java Essentials,New To Java...
# 2
the Vector is filled with metadata, tho it equates to a string...it is information read from a database
McPheea at 2007-7-10 3:36:36 > top of Java-index,Java Essentials,New To Java...
# 3
If it's inserted into the vector as a String, then the toArray() method is exactly what you want. Otherwise, a simple for loop doing a "array[i] = thing.toString()" bit ought to do nicely.
kevjavaa at 2007-7-10 3:36:36 > top of Java-index,Java Essentials,New To Java...
# 4
i found that the toArray method didnt work correctly for me in 1.4 unless i did thisString[] st = list.toArray(new String[]{});
mkoryaka at 2007-7-10 3:36:36 > top of Java-index,Java Essentials,New To Java...