Search a list: Difference between revisions
Content added Content deleted
Thundergnat (talk | contribs) (Rename Perl 6 -> Raku, alphabetize, minor clean-up) |
Thundergnat (talk | contribs) m (Fix Perl 6 -> Raku links) |
||
Line 3,067: | Line 3,067: | ||
</pre> |
</pre> |
||
The built-in method <code>.first</code> takes a [https://docs. |
The built-in method <code>.first</code> takes a [https://docs.raku.org/language/operators#infix_~~ smart-matcher], and returns the first matching list element.<br> |
||
The <code>:k</code> adverb tells it to return the key (a.k.a. list index) instead of the value of the matching element.<br> |
The <code>:k</code> adverb tells it to return the key (a.k.a. list index) instead of the value of the matching element.<br> |
||
The <code>:end</code> adverb tells it to start searching from the end of the list.<br> |
The <code>:end</code> adverb tells it to start searching from the end of the list.<br> |