Count how many vowels and consonants occur in a string: Difference between revisions
Count how many vowels and consonants occur in a string (view source)
Revision as of 19:10, 26 July 2021
, 2 years ago→{{header|ALGOL 68}}: formatting...
(→{{header|ALGOL 68}}: Slight simplification) |
m (→{{header|ALGOL 68}}: formatting...) |
||
Line 10:
# returns the 0-based index of the upper case letter c in the alphabet #
# or -1 if c is not a letter #
OP L
IF c >= "A" AND c <= "Z" THEN ABS c - ABS "A" ELIF c >= "a" AND c <= "z" THEN ABS c - ABS "a" ELSE -1 FI;
# prints the counts of vowels and consonants in s #
|