Anonymous user
Remove vowels from a string: Difference between revisions
m
→using character eliding: changed a comment.
(→{{header|REXX}}: added a 2nd version.) |
m (→using character eliding: changed a comment.) |
||
Line 28:
x= . || x /*prefix string with a dummy character.*/
do j=length(x)-1 by -1 for length(x)-1 /*process the string from the
_= pos( substr(x, j, 1), 'AEIOUaeiou') /*is this particular character a vowel?*/
if _==0 then iterate /*if zero (not a vowel), then skip it.*/
Line 34:
end /*j*/
x= substr(x, 2) /*elide the prefixed dummy
say 'output string: ' x /*stick a fork in it, we're all done. */</lang>
{{out|output|text= is identical to the 1<sup>st</sup> REXX version.}} <br><br>
|