string x = y ? "foo" : "bar";
string x = some_strings[y];
Regarding the ternary, nested ternary expressions aren't the most readable thing.
Regarding table lookup, sure but only if all values of y are sequential integers.