What I am using: I have multiple arrays
String[] cat = {"schema cat","schemacat","schemac"}
String[] dog = {"schema dog","schemadog","schemad"}
String[] horse = {"schema horse","schemachorse","schemah"}
I am getting a value to my method for example schema cat and I need to find in which array it is written. But I can sometimes get schemac or cat instead of schema cat.
Problem: So I need to find in which array is containing value.
What I have tried: I have tried writing multiple if cases but it's getting to messy and complicated. I am wondering what is the best solution for this case. I was thinking about switch, but don't know how to solve case situations.
schema catexists in any array or not.String.containsis what you need.