Convert switch of strings to if with equals