I'm trying to figure out a smart way to comma separate a list, while the separator between the last two elements should be an and.
So for instance, I would like this string
listOf<Fruits>(Fruit.APPLE, Fruit.ORANGE, Fruit.BANANA)
to print out this:
"Apple, Orange and Banana"
Tried the simple joinToString, but that only allows a single separator, so that would just leave it comma separated all the way. Any smart way to do this? Haven't really been able to properly find an answer.