I have an ArrayList with genres:
List<String> availableGenres = new ArrayList<>(Arrays.asList("Arcade", "Puzzle", "Racing", "Casual",
"Strategy", "Sport")
);
I want to check if incoming string exists in this ArrayList. Okay, it's simple with contains, incoming "Sport":
if (availableGenres.contains(game.getGenre())){
...
this true
}
But sometimes incoming String contains both of these values, like this: "Puzzle Arcade" and this method will return false, but it's actually true. How to deal with this case?