Find words whose first and last three letters are equal: Difference between revisions

Content added Content deleted
(Added XPL0 example.)
(Add Red)
Line 672: Line 672:
for IN.IO.lines { .say if .chars > L and .substr(0,N) eq .substr(*-N,*) }
for IN.IO.lines { .say if .chars > L and .substr(0,N) eq .substr(*-N,*) }
</lang>
</lang>
{{out}}
<pre>
antiperspirant
calendrical
einstein
hotshot
murmur
oshkosh
tartar
testes
</pre>

=={{header|Red}}==
<lang rebol>Red[]

foreach word read/lines %unixdict.txt [
if all [
greater? length? word 5
equal? take/part copy word 3 take/part/last copy word 3
][
print word
]
]</lang>
{{out}}
{{out}}
<pre>
<pre>