I want to write if(myFunction.equals("This String OR This string")){ My code } Unable to implement the logic.
Asked
Active
Viewed 33 times
-1
-
Do you mean comparing with two strings? – Majed Badawi Apr 08 '20 at 19:16
-
Look at the official java tutorial https://docs.oracle.com/javase/tutorial/java/nutsandbolts/op2.html for basic syntax – NotZack Apr 08 '20 at 19:17
-
`if(myFunction.equals("This String") || myFunction.equals("This string"))` – GriffeyDog Apr 08 '20 at 19:17
1 Answers
0
You can't do that as you want it from our example. You have to do it like so:
if(myFunction.equals(firstString) || myFunction.equals(secondString))

PaianganuOm
- 254
- 1
- 10