Remove vowels from a string: Difference between revisions
Content added Content deleted
(Added Python lambda implementation) |
(Added solution for Action!) |
||
Line 70: | Line 70: | ||
<pre>TH QCK BRWN FX jmps vr th lzy dg</pre> |
<pre>TH QCK BRWN FX jmps vr th lzy dg</pre> |
||
=={{header|Action!}}== |
|||
<lang Action!>BYTE FUNC IsVovel(CHAR c) |
|||
CHAR ARRAY vovels="AEIOUaeiou" |
|||
BYTE i |
|||
FOR i=1 TO vovels(0) |
|||
DO |
|||
IF vovels(i)=c THEN |
|||
RETURN (1) |
|||
FI |
|||
OD |
|||
RETURN (0) |
|||
PROC RemoveVovels(CHAR ARRAY s,res) |
|||
BYTE i |
|||
CHAR c |
|||
res(0)=0 |
|||
FOR i=1 TO s(0) |
|||
DO |
|||
c=s(i) |
|||
IF IsVovel(c)=0 THEN |
|||
res(0)==+1 |
|||
res(res(0))=c |
|||
FI |
|||
OD |
|||
RETURN |
|||
PROC Test(CHAR ARRAY s) |
|||
CHAR ARRAY res(256) |
|||
RemoveVovels(s,res) |
|||
PrintE("Input:") PrintE(s) |
|||
PrintE("Output:") PrintE(res) |
|||
RETURN |
|||
PROC Main() |
|||
Test("The Quick Brown Fox Jumped Over the Lazy Dog's Back") |
|||
Test("Action! is a programming language for Atari 8-bit computer.") |
|||
RETURN</lang> |
|||
{{out}} |
|||
[https://gitlab.com/amarok8bit/action-rosetta-code/-/raw/master/images/Remove_vowels_from_a_string.png Screenshot from Atari 8-bit computer] |
|||
<pre> |
|||
Input: |
|||
The Quick Brown Fox Jumped Over the Lazy Dog's Back |
|||
Output: |
|||
Th Qck Brwn Fx Jmpd vr th Lzy Dg's Bck |
|||
Input: |
|||
Action! is a programming language for Atari 8-bit computer. |
|||
Output: |
|||
ctn! s prgrmmng lngg fr tr 8-bt cmptr. |
|||
</pre> |
|||
=={{header|Ada}}== |
=={{header|Ada}}== |