Is there an "in" Python keyword equivalent in Java? -
this question has reply here:
how can test if array contains value? 23 answerswhat simple/efficient way of implementing next python code in java?
if "foo" in ["foo", "bar"]: print "found."
if have info in array utilize this
string[] strings = {"foo","bar"}; (string s : strings) { if (s.equals("foo")) { system.out.println("found"); break; } }
java python
No comments:
Post a Comment