Words containing "the" substring: Difference between revisions

→‎{{header|Smalltalk}}: back to previous version; me stupid.
(→‎{{header|Smalltalk}}: back to previous version; me stupid.)
Line 667:
 
=={{header|Smalltalk}}==
Not clear to me if case matters or not. The code does either (replace trueOrFalseWhoKnows by true or false)
mhmm - I interpret the words "in this page" as to read the URL and fetch the page then search those words there...
Also, it was not clear to me if case matters or not.
 
{{works with|Smalltalk/X}}
<lang smalltalk>dict := 'unixdict.txt' asFilename contents asSet.
page := 'https://www.rosettacode.org/wiki/Words_containing_%22the%22_substring' asURL retrieveContents.
page asCollectionOfWords
select:[:word |
(dict includes:word)
and:[ (word size > 11)
and:[ word includesString:'the' caseSensitive:trueOrFalseWhoKnows ]]]
thenDo:#transcribeCR</lang>
 
if not, then take the following:
<lang smalltalk>'unixdict.txt' asFilename contents
select:[:word | (word size > 11) and:[word includesString:'the']]
Anonymous user