Count how many vowels and consonants occur in a string: Difference between revisions

Content added Content deleted
(RPL: add section)
Line 2,146: Line 2,146:
In string occur 19 consonants
In string occur 19 consonants
done...</pre>
done...</pre>

=={{header|RPL}}==
{{works with|Halcyon Calc|4.2.8}}
≪ "AEIOU" → str voy
≪ (0,0) 1 str SIZE '''FOR''' j
str j DUP SUB
'''IF''' DUP "a" ≥ OVER "z" ≤ AND '''THEN''' NUM 32 - CHR '''END'''
'''IF''' DUP "A" ≥ OVER "Z" ≤ AND '''THEN''' voy SWAP POS 1 (0,1) IFTE + '''ELSE''' DROP '''END'''
'''NEXT'''
≫ ≫ ''''VOYCON'''' STO

"Now is the time for all good men to come to the aid of their country." '''VOYCON'''
{{out}}
<pre>
1: (22,31)
</pre>


=={{header|Ruby}}==
=={{header|Ruby}}==