Home > Contents > Index >
Expanded TOC | Accordion TOC | Annotated TOC | Index
Utilities.itemIsInList
Determines if a given string is in a vector.
Syntax
public static final boolean itemIsInList(Vector list, String str, boolean case)Parameters
list- Input. Specify the Vector containing a list of strings.
str- Input. Specify the string to find in
l.
case- Input. Specify
trueto perform a case-insensitive search, specifyfalseto specify a case-sensitive search.
Returns
Returns
trueif the string is in the vector,falseif it is not.Example
The following code determines if
Futureis one of the strings in theactualVector:
Vector actualVector = new Vector(); actualVector.addElement("Open"); actualVector.addElement("Future"); actualVector.addElement("dvin"); actualVector.addElement("Fat"); boolean flag = Utilities.itemIsInList(actualVector,"Future",false); if (flag) { // Yes, Future is one of the strings in actualVector. }
Home > Contents > Index > ![]()
Oracle JAVA Reference
Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.