> How to read an input regardless of upper or lowercase?

How to read an input regardless of upper or lowercase?

Posted at: 2014-12-18 
I am using netbeans (java) and I need to be able to read if the user inputs triangle or square and it has to read it even if they input triAnGle.

String shape = scan.next().toLowerCase ();

will convert it on input.

Or you can read it without conversion and then use

if (shape.equalsIgnoreCase ("triangle"))

I am using netbeans (java) and I need to be able to read if the user inputs triangle or square and it has to read it even if they input triAnGle.