在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
}