Java - 在字符串数组中搜索字符串例:
在java中,我们有任何方法可以找到特定的字符串是字符串数组的一部分。我可以在一个循环中做,我想避免。
例如:
String [] array = {"AA","BB","CC" };
string x = "BB"
我想要一个
if (some condition to tell whether x is part of array) {
do something
} else {
do something else
}