__switch

fnint __switch(T, caseLabels...)(/*in*/ const scope T[] condition) pure nothrow @safe @nogc

Support for switch statements switching on strings.

Parameters

caseLabelssorted array of strings generated by compiler. Note the strings are sorted by length first, and then lexicographically.
conditionstring to look up in table

Returns

index of match in caseLabels, a negative integer if not found