Anonymous user
String matching: Difference between revisions
→{{header|Perl 6}}: Only show sensible ways to do it
(→{{header|Perl 6}}: The "full program" boilerplate was obscuring the interesting stuff. Show individual expressions only, like the #Perl solution.) |
(→{{header|Perl 6}}: Only show sensible ways to do it) |
||
Line 2,068:
so $haystack ~~ / $needle / # True if $haystack contains $needle
so $haystack ~~ / $needle $/ # True if $haystack ends with $needle</lang>
Using <code>substr</code>:
|