I am trying to find a method to read an array like this.
String[] operators = {"+", "-"}; if(operation.contains(operators)) System.out.println("noob"); else System.out.println("noobcake");
The contains method will not read from the array but it works when I use it like this,
if(operation.contains("/") || (operation.contains("divide") || (operation.contains("division") || (operation.contains("Divide") || (operation.contains("Division")))))) System.out.println(total = firstnumber / secondnumber); else System.out.println("You didn't enter a Valid Operator");
but this uses a bunch of unnecessary space and would be easier to edit with an array.
So my question is what method can I use to read from the array and apply to this situation?
I started java a week ago, so I am just trying to get used to it, and write lots of test programs.