how to pass string as vector object
10 1514
how to pass string as vector object
What do you mean by that?
how to pass string as vector object
Welcome to TSDN.
What you want, if I am not wrong..... You want a String as a Vector Element.
Or, (String)new Vector().
Kind regards,
Dmjpro.
(String)new Vector()[/b].
Kind regards,
Dmjpro.
That cast will fail miserably; even the compiler can detect that. Maybe you mean: -
(new Vector()).toString();
-
... which doesn't do anything useful either.
kind regards,
Jos
That cast will fail miserably; even the compiler can detect that. Maybe you mean: -
(new Vector()).toString();
-
... which doesn't do anything useful either.
kind regards,
Jos
Or maybe you mean: - String someString = (String) Vector.elementAt(i);
However, if you're using Java 1.5 or later, just use the Vector like this: -
Vector<String> someVector = new Vector<String>();
-
someVector.add("Hi there!");
-
String someString = someVector.elementAt(0);
-
I changed the thread title but I still have no idea if it reflects what the OP needs.
kind regards,
Jos
I changed the thread title but I still have no idea if it reflects what the OP needs.
kind regards,
Jos
Stumped me as well that's why I'd left it like that.
Stumped me as well that's why I'd left it like that.
I'm afraid this is one of the many threads that become forgotten threads. It happens
all the time; quite disappointing if you'd ask me: an OP asks a vague question;
people try to help and ask further questions and then: void, silence, the abyss;
I wonder if the OPs are happy with it ...
kind regards,
Jos
I'm afraid this is one of the many threads that become forgotten threads. It happens
all the time; quite disappointing if you'd ask me: an OP asks a vague question;
people try to help and ask further questions and then: void, silence, the abyss;
I wonder if the OPs are happy with it ...
kind regards,
Jos
However, someone randomly surfing through the forums (myself), may find the responses very helpful.
Thanks!
However, someone randomly surfing through the forums (myself), may find the responses very helpful.
Thanks!
Well, that's at least one person we've helped! ^^
how to pass string as vector object
If u want to pass the String value as Vector object, like this - String name = "ravinttf32";
-
java.util.Vector vector = new java.util.Vector();
-
vector.addElement(name);
-
request.setAttribute("sendreqvector",vector);
otherwise, if u want to pass the vector Element as String object, like this - java.util.Vector vector = (java.util.Vector)request.getAttribute("sendreqvector");
-
String name="";
-
for(int i=0;i<vector.size(); i++)
-
{
-
name = String.valueOf(vector.elementAt(0));
-
}
-
request.setAttribute("sendreqname",name);
Is it clear...
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Rich |
last post by:
HI,
I am working on a program which implements the simplex aglorithm. I
have decided to use a vector of vectors to set up my matrix. My
initial thought was to fill the row vector with type...
|
by: chris |
last post by:
Hello,
I've recently been trying to understand the various structures supplied
by c++, and the one I find most confusing is deque.
One quick question about this. It seems most implementations...
|
by: Dekker |
last post by:
Hi
I would like to transform the result of a csv-string (eg.:
"name,age\nstring,int\nMac,23\nMax,24\nMike,78") into a map of vectors
map<string, vector<???> >.
The key of the map will be the...
|
by: Ben Wheare |
last post by:
Hiya,
I'm fairly new to C++, and trying to figure out how to do the following:
I have a class, strings, which has a private char array. To add to
this array, I call the member function...
|
by: pallav |
last post by:
I am writing a logic simulator for boolean circuits. I have a textfile which will contain vectors like this
abc
001
100
111
...
I want to be able to bit pack these vectors to get a = 110, b...
|
by: andrewmorrey |
last post by:
Hello,
I've got a VC++ project containing multiple classes and a main
function. In one of the class functions, it reads from a text file and
places the data into a vector;
//...
|
by: flavourofbru |
last post by:
Hi,
I know how to read a text file into a vector by using strings.
Now i need to append an integer to the end of the text file. And then add one more vector elements to the end of the text file....
|
by: mersinli |
last post by:
Hello;
I will use standard library vectors and implement simple map coloring algorithm. The goal of a map coloring problem is to color a map so that regions sharing a common border have...
|
by: Caudata |
last post by:
I am by no means an experienced c++ programmer, but I am trying to use a vector of vectors because it is convenient to store some strings while parsing a text file. I am having trouble with the...
|
by: Ushario |
last post by:
Hi, I need to make a vector that will store a bunch of names for a random name generator. I need to know if I can use a vector to store strings instead of chars.
Like this:
std::vector<std::string>...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
| |