Comparison of programming languages (string functions): Difference between revisions

Content deleted Content added
Loudogni (talk | contribs)
Lowercase: Specify Perl 6 example
Loudogni (talk | contribs)
replace: Add Perl 6 snippet
Line 2,114:
"effffff".replace("f", "jump"); // returns "ejumpjumpjumpjumpjumpjump"
"effffff".replaceAll("f*", "jump"); // returns "ejump"
</syntaxhighlight>
 
<syntaxhighlight lang="perl6">
// Examples in Perl 6
"effffff".subst("f", "jump", :g); # returns "ejumpjumpjumpjumpjumpjump"
"blah".subst("z", "y", :g); # returns "blah"
</syntaxhighlight>