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

m
(→‎{{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 = ( CHAR c )INT:
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 #
3,060

edits