The program should take a string as input and reverse the consonants in it, while keeping the order of vowels. All the letters will be lowercase, so you don't have to worry about casing. Examples follow.
Input:
a test case
.
The consonants here aret,s,t,c,s
. They should come in reversed order, i.e.s,c,t,s,t
and inserted back into the string to the same positions where the pre-reversed characters were located:a sect sate
.Input:
well-done
. Output:nedl-lowe
.- Input:
reverse the consonants
. Output:setenne sne cohtosarvr
.
This is the code golf, the shortest solution wins.
Y
should be considered vowel regardless of what it is and not reversed.
Anything, as well as numbers, punctuation, quotes, and other symbols (@#$%^&*(){}[]\|/<>~-_+=`
), could potentially appear in the input.