SyntaxFix
Write A Post
Hire A Developer
Questions
Tags
I have an if statement:
if
if (inventory.contains("bread"))
But now I want to check
inventory
How can I do this?
This question is related to java contains
java
contains
Maybe
if (inventory.contains("bread") && !inventory.contains("water"))
Or
if (inventory.contains("bread")) { if (!inventory.contains("water")) { // do something here } }
Source: Stackoverflow.com