I want to know if there's a way of doing something like this in Java :
if(word in stringArray) {
...
}
I know I can make a function for this but I just want to know if Java has already something for this.
Thank you!
解决方案
There are many collections that will let you do something similar to that. For example:
String s = "I can has cheezeburger?";
boolean hasCheese = s.contains("cheeze");
List listOfStrings = new ArrayList();
boolean hasString = listOfStrings.contains(something);
However, there is no similar construct for a simple String[].