vectors

im using a vector to store some dictionary information and have the following if statement

if (dictionary.contains(new String (x)))

{

System.out.println("Found");

}

This works fine but i want to find out the element it was found at, any ideas on how to do this?

[313 byte] By [lucasio76] at [2007-9-30 4:02:09]
# 1
Look at the indexOf() method. And you don't need to create a new String in this case - just use x...
yawmark at 2007-6-29 17:35:37 > top of Java-index,Archived Forums,Java Programming...
# 2
that worked, thanks!
lucasio76 at 2007-6-29 17:35:37 > top of Java-index,Archived Forums,Java Programming...