Remove vowels from a string: Difference between revisions
m
→{{header|EasyLang}}
No edit summary |
|||
(17 intermediate revisions by 10 users not shown) | |||
Line 529:
{{out}}
<pre>TH QCK BRWN FX jmps vr th lzy dg.</pre>
=={{header|BQN}}==
<syntaxhighlight lang="bqn">Devowel ← ¬∘∊⟜"AaEeIiOoUu"⊸/</syntaxhighlight>
=={{header|C}}==
Line 757 ⟶ 760:
After: Th qck brwn fx jmps vr th lzy dg
</pre>
=={{header|EasyLang}}==
<syntaxhighlight>
func$ rmv s$ .
for c$ in strchars s$
if strpos "AEIOUaeiou" c$ <> 0
c$ = ""
.
r$ &= c$
.
return r$
.
print rmv "The Quick Brown Fox Jumped Over the Lazy Dog's Back"
</syntaxhighlight>
=={{header|F_Sharp|F#}}==
Line 875 ⟶ 892:
writeLn(line)
end.</syntaxhighlight>
=={{header|Frink}}==
<syntaxhighlight lang="frink">s = """Rosetta Code is a programming chrestomathy site.
The idea is to present solutions to the same
task in as many different languages as possible,
to demonstrate how languages are similar and
different, and to aid a person with a grounding
in one approach to a problem in learning another."""
println[s =~ %s/[aeiou]//gi ]</syntaxhighlight>
{{out}}
<pre>
Rstt Cd s prgrmmng chrstmthy st.
Th d s t prsnt sltns t th sm
tsk n s mny dffrnt lnggs s pssbl,
t dmnstrt hw lnggs r smlr nd
dffrnt, nd t d prsn wth grndng
n n pprch t prblm n lrnng nthr.
</pre>
=={{header|Fōrmulæ}}==
{{FormulaeEntry|page=https://formulae.org/?script=examples/Remove_vowels_from_a_string}}
'''Solution'''
[[File:Fōrmulæ - Remove vowels from a string 01.png]]
[[File:Fōrmulæ - Remove vowels from a string 02.png]]
=={{header|FutureBasic}}==
Line 953 ⟶ 991:
main :: IO ()
main = putStrLn $ exceptGlyphs "eau" txt</syntaxhighlight>
{{Out}}
Line 965 ⟶ 999:
diffrnt, nd to id prson with gronding
in on pproch to problm in lrning nothr.</pre>
=={{header|J}}==
<syntaxhighlight lang="j">devowel =: -. & 'aeiouAEIOU'</syntaxhighlight>
=={{header|Java}}==
You can use the ''String.replaceAll'' method, which takes a regular expression as it's first argument.
<syntaxhighlight lang="java">
"rosettacode.org".replaceAll("(?i)[aeiou]", "");
</syntaxhighlight>
<br />
Or
<syntaxhighlight lang="java">public static String removeVowelse(String str){
String re = "";
Line 1,291 ⟶ 1,334:
diffrnt, nd to id prson with gronding
in on pproch to problm in lrning nothr.</pre>
=={{header|Joy}}==
<syntaxhighlight lang="joy">DEFINE unvowel == ["AaEeIiOoUu" in not] filter.
"Remove ALL vowels from this input!" unvowel putchars.</syntaxhighlight>
{{out}}
<pre>Rmv LL vwls frm ths npt!</pre>
=={{header|jq}}==
Line 1,397 ⟶ 1,447:
dctn shll b fr, t lst n th lmntry nd fndmntl stgs.
</pre>
=={{header|K}}==
{{works with|ngn/k}}
<syntaxhighlight lang=K>novowel: {x^"aeiouAEIOU"}
novowel"The Quick Brown Fox Jumped Over the Lazy Dog's Back"
"Th Qck Brwn Fx Jmpd vr th Lzy Dg's Bck"
</syntaxhighlight>
=={{header|Kotlin}}==
Line 1,508 ⟶ 1,566:
<pre>The quick brown fox jumps over the lazy dog
Th qck brwn fx jmps vr th lzy dg</pre>
=={{header|OCaml}}==
<syntaxhighlight lang="ocaml">let remove_vowels s : string =
let not_vowel = Fun.negate (String.contains "AaEeIiOoUu") in
String.to_seq s |> Seq.filter not_vowel |> String.of_seq</syntaxhighlight>
=={{header|Pascal}}==
Line 1,949 ⟶ 2,012:
String without vowels: Rng Prgrmmng Lngg
</pre>
=={{header|RPL}}==
≪ "AEIOUaeiou" → string vowels
≪ "" 1 string SIZE '''FOR''' j
string j DUP SUB
'''IF''' vowels OVER POS '''THEN''' DROP '''ELSE''' + '''END'''
'''NEXT'''
≫ ≫ ''''NOVWL'''' STO
{{in}}
<pre>
"This is a difficult sentence to pronounce" NOVWL
</pre>
{{out}}
<pre>
1: "Ths s dffclt sntnc t prnnc"
</pre>
=={{header|Ruby}}==
<syntaxhighlight lang="ruby">
Line 1,982 ⟶ 2,061:
Frrs, th crb, s th nffcl msct f th Rst Prgrmmng Lngg
</pre>
=={{header|sed}}==
<syntaxhighlight lang="sed">s/[AaEeIiOoUu]//g</syntaxhighlight>
=={{header|Smalltalk}}==
Line 2,083 ⟶ 2,165:
Output : Vsl Bsc .NT</pre>
=={{header|V (Vlang)}}==
{{trans|AutoHotkey}}
<syntaxhighlight lang="v (vlang)">fn main() {
mut str := 'The quick brown fox jumps over the lazy dog'
for val in 'aeiou'.split('') {str = str.replace(val,'')}
Line 2,098 ⟶ 2,180:
=={{header|Wren}}==
<syntaxhighlight lang="
var s = "Wren Programming Language"
|