Home > Contents > 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
true
to perform a case-insensitive search, specifyfalse
to specify a case-sensitive search.
Returns
Returns
true
if the string is in the vector,false
if it is not.Example
The following code determines if
Future
is 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, 2018, Oracle and/or its affiliates. All rights reserved.