Anonymous user
Words containing "the" substring: Difference between revisions
→{{header|Smalltalk}}
(→{{header|Smalltalk}}: format) |
|||
Line 557:
select:[:word | (word size > 11) and:[word includesString:'the']]
thenDo:#transcribeCR</lang>
Variant (as script file):
<br>File: "filter.st":
<lang smalltalk>#! /usr/bin/env stx --script
[Stdin atEnd] whileFalse:[
|word|
((word := Stdin nextLine) size > 11
and:[word includesString:'the']
) ifTrue:[
Stdout nextPutLine: word
]
]</lang>
Execute with:
<lang shell>chmod +x filter.st
./filter.st < unixdict.txt</lang>
{{out}}
<pre>authenticate
|