switch(type) { case "SomeString": // Functionality break; case "OtherString": // Functionality break; default: // Functionality break; }