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

Content deleted Content added
Loudogni (talk | contribs)
rfind: Fix commented line for Perl 5 and Perl 6
Loudogni (talk | contribs)
split: Add Perl 6 snippet
Line 2,649:
# Examples in Perl 5
split(/spam/, 'Spam eggs spam spam and ham'); # ('Spam eggs ', ' ', ' and ham')
split(/X/, 'Spam eggs spam spam and ham'); # ('Spam eggs spam spam and ham')
</syntaxhighlight>
 
<syntaxhighlight lang="perl6">
# Examples in Perl 6
'Spam eggs spam spam and ham'.split(/spam/); # (Spam eggs and ham)
split(/X/, 'Spam eggs spam spam and ham'); # (Spam eggs spam spam and ham)
</syntaxhighlight>
 
<!-- endsection -->