Here you can find the source of getposString(Vector vect_valores, String valor)
Returns the position of the element at the vector, -1 if does not appear
Parameter | Description |
---|---|
vect_valores | Vector of values |
valor | Value to seek |
public static int getposString(Vector vect_valores, String valor)
//package com.java2s; //License from project: Open Source License import java.util.*; public class Main { /**/*from ww w .j a va 2 s.com*/ * <p> * Returns the position of the element at the vector, -1 if does not appear * </p> * @param vect_valores Vector of values * @param valor Value to seek * @return Position of the value searched */ public static int getposString(Vector vect_valores, String valor) { for (int i = 0; i < vect_valores.size(); i++) if (vect_valores.elementAt(i).equals(valor)) return (i); return (-1); } }