Find words whose first and last three letters are equal: Difference between revisions
Content deleted Content added
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
|