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 01:25, 27 November 2021
, 2 years ago→{{header|Ring}}: simplified, removed unnecessary library dependency and chance of mis-tabulation of characters after "Z" and before "a"
Alpha bravo (talk | contribs) (Added AutoHotkey) |
(→{{header|Ring}}: simplified, removed unnecessary library dependency and chance of mis-tabulation of characters after "Z" and before "a") |
||
Line 1,635:
=={{header|Ring}}==
<lang ring>? "working..."
str = '"' + "Forever Ring Programming Language" + '"'
vowel = 0 vowels = [] for x in "AEIOUaeiou" add(vowels, x) next
ltrc = 0 all = 'A':'z' while all[27] != 'a' del(all, 27) end
for n
if find(vowels, n) > 0 vowel++ ok
if
next
{{out}}
<pre>working...
Input string = "Forever Ring Programming Language"
In string occur 11 vowels
In string occur 19 consonants
done...</pre>
=={{header|Ruby}}==
|