Re: Convert a string to a vector?
From: Andrew Thompson (SeeMySites_at_www.invalid)
Date: 02/17/04
- Next message: Piet den Dulk: "Re: Thread.sleep?"
- Previous message: lonelyplanet999: "Re: Question about 310-035 exam"
- In reply to: Nishi Bhonsle: "Convert a string to a vector?"
- Next in thread: Thomas Schodt: "Re: Convert a string to a vector?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 17 Feb 2004 21:45:54 GMT
Nishi Bhonsle wrote:
....
> I have 2 vectors of 10 elements each and I needed to make a single
> vector out of them.
Why? What is the actual input you have
and the output you require?
It depends on why you ever had vectors,
they use much more resources than arrays.
>..So I converted both the vectors to strings using
> the toString() method of vector class and then used the concat()
> method of the String class to concatenate the strings.
If you want to end up with 20 elements in
a new data vector or array, converting them
to strings in the meantime is a terribly bad idea.
A better way is to create a single array/vector
as big as both, then simply loop through
each and add the elements to the final data
vector/array.
_However_
You need to direct your question over to..
http://groups.google.com.au/groups?group=comp.lang.java.help
where these sorts of questions are answered.
-- Andrew Thompson * http://www.PhySci.org/ Open-source software suite * http://www.PhySci.org/codes/ Web & IT Help * http://www.1point1C.org/ Science & Technology
- Next message: Piet den Dulk: "Re: Thread.sleep?"
- Previous message: lonelyplanet999: "Re: Question about 310-035 exam"
- In reply to: Nishi Bhonsle: "Convert a string to a vector?"
- Next in thread: Thomas Schodt: "Re: Convert a string to a vector?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|