I am trying to come up with a verb that will take a string as input and printa character uppercase if it is a vowel i.e. (aeiou) or lowercase if it is a consonant.
s=:'authority'
t=:<&>s
│a│u│t│h│o│r│i│t│y│ NB. boxed s
Expected output is : AUthOrIty
I tried writing verb using control flow structure using e.(membership) to test if a char
is a vowel and then echo toupper s but that doesn't work.
You don't need to box on individual characters.
"0will apply an atom at a time and in this case your characters are atoms.I would use
e.to check to see if a character is a vowel and if it is applytoupperby using the^:power conjunction on the teste.&vow