Given :
String[] directions = {"UP","DOWN","RIGHT","LEFT","up","down","right","left"};
String input = "Up";
How can I verify that an input from stdin
is within the directions
array or not ?
I can make a loop and check each item with input
using equal ,but I'm looking for a more elegant way.
Regards,Ron