Skip to main content
1 of 2
Giuseppe
  • 28.8k
  • 3
  • 31
  • 105

SNOBOL4 (CSNOBOL4), 148 bytes

 S =INPUT
N S ARB . L ANY('aeiou') . C REM . S :F(O)
 EQ(X) :S(A)
 &LCASE @P C
 &UCASE LEN(P) LEN(1) . C
A O =O L C
 X =1 - X :(N)
O OUTPUT =O S
END

Try it online!

Giuseppe
  • 28.8k
  • 3
  • 31
  • 105