This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
The moose likes Java in General and the fly likes Getting value from Vector Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Getting value from Vector " Watch "Getting value from Vector " New topic

Getting value from Vector

Anand Karia
Ranch Hand

Joined: Sep 25, 2004
Posts: 156

Hi All

I m using Vector that has following data


how can i get data i.e 450 from this vactor that appear after comma.


Love is GOD and GOD is Love.
Anand Karia
IT Concretor.......
M/s. Anand Karia Concreting IT
Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

The JDK API JavaDocs are a good place to get answers for this sort of question. From the JavaDOc for a Vector:

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Mohammed Ajmal

Joined: Sep 20, 2004
Posts: 29

As said use the String strVal = vector.get(index) pass the index to it. Use string tokenizer to get the value after comma from string.

rocket mass heater kickstarter
subject: Getting value from Vector