When working with strings you can check if a string belongs to a string set like this:
if (a in listOf("ab", "abab")) { // do somethin