Find words whose first and last three letters are equal: Difference between revisions
Content added Content deleted
ReeceGoding (talk | contribs) (Added R.) |
(→{{header|Ruby}}: Add Ruby) |
||
Line 697: | Line 697: | ||
</pre> |
</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}}== |
=={{header|Swift}}== |
||
<lang swift>import Foundation |
<lang swift>import Foundation |