Remove vowels from a string: Difference between revisions

Line 1,296:
<pre>The balloon above harsh harsh waters of programming languages, is the mascot of Smalltalk
Th blln bv hrsh wtrs f prgrmmng lnggs, s th msct f Smlltlk</pre>
 
As usual, there are many alternative ways to do this:
<lang smalltalk>
out := in reject:#isVowel. " cool: symbols understand value: "
out := in select:[:ch | ch isVowel not].
out := in reject:[:ch | 'aeiou' includes:ch asLowercase ].
out := in reject:[:ch | #( $a $e $i $o $u ) includes:ch asLowercase ].
out := in reject:[:ch | 'AaEeIiOoUu' includes:ch ].
out := String streamContents:[:s |
in do:[:ch |
ch isVowel ifTrue:[ s nextPut:ch ]
]]
</lang>
 
=={{header|Visual Basic .NET}}==
Anonymous user