Find words whose first and last three letters are equal: Difference between revisions
Find words whose first and last three letters are equal (view source)
Revision as of 18:44, 26 October 2021
, 2 years ago→{{header|Ruby}}: Add Ruby
ReeceGoding (talk | contribs) (Added R.) |
(→{{header|Ruby}}: Add Ruby) |
||
Line 697:
</pre>
=={{header|Ruby}}==
<lang ruby>words = File.readlines("unixdict.txt").map(&:chomp)
puts words.select{|w| w.end_with?(w[0,3]) && w.size > 5}
</lang>
{{out}}
<pre>antiperspirant
calendrical
einstein
hotshot
murmur
oshkosh
tartar
testes
</pre>
=={{header|Swift}}==
<lang swift>import Foundation
|