Syntax of switch + case insensitive?

So there’s an input, and some commands, I want to check what people are typing in, or if it’s just normal chat message. err, and I use a switch, but I also want a case insensitive on the checks. Example script, from current version of script, this works, but the input has to be case sensitive, or it won’t register them…

switch(Console Input From Player)
{

case "/example1" :
{
}
break;

case "/example2" :
{
}
break;

default :
{
}
break;

This was resolved by myself, before Pheash answer, posting answer for future reference to the community:

The problem was, that I couldn’t assign the comparison that was case in-dependent, so what I did, was instead of adding them on a case basis, just lower casing the entire search option as follows:

switch([STRING].ToLower () ){

Hi,
This might be more of a pointer into a possible direction, as i havent tried it or done it myself:
you can use .NET functions have a look here:
http://docs.unity3d.com/Documentation/ScriptReference/MonoCompatibility.html
there is one in there called ToLower() which converts a string to lower case.

  1. convert the user input to lower case

  2. compare lowercase version to your list via switch statement

That way it doesnt matter if the user input is “\ExAmPLe1” or “\exaMple1”

I know that normal java has a function called: compareToIgnoreCase(String), it compares 2 strings and ignores the case. I am not 100% sure you can use that one