Words containing "the" substring: Difference between revisions

Content added Content deleted
(add Standard ML)
(Standard ML: simplify)
Line 918: Line 918:


=={{header|Standard ML}}==
=={{header|Standard ML}}==
<lang sml>val noThe = Substring.isEmpty o #2 o Substring.position "the"
<lang sml>val hasThe = String.isSubstring "the"


fun isThe12 s = size s > 11 andalso hasThe s
fun printThe12 s =
if Substring.size s < 12 orelse noThe s
then ()
else print (Substring.string s ^ "\n")


val () = (List.app printThe12
val () = print
((String.concatWith " "
o Substring.tokens Char.isSpace
o List.filter isThe12
o Substring.full
o String.tokens Char.isSpace
o TextIO.inputAll) TextIO.stdIn</lang>
o TextIO.inputAll) TextIO.stdIn ^ "\n")</lang>
{{out}}
{{out}}
<pre>authenticate chemotherapy chrysanthemum clothesbrush clotheshorse eratosthenes featherbedding featherbrain featherweight gaithersburg hydrothermal lighthearted mathematician neurasthenic nevertheless northeastern northernmost otherworldly parasympathetic physiotherapist physiotherapy psychotherapeutic psychotherapist psychotherapy radiotherapy southeastern southernmost theoretician weatherbeaten weatherproof weatherstrip weatherstripping</pre>
<pre>authenticate
chemotherapy
chrysanthemum
clothesbrush
clotheshorse
eratosthenes
featherbedding
featherbrain
featherweight
gaithersburg
hydrothermal
lighthearted
mathematician
neurasthenic
nevertheless
northeastern
northernmost
otherworldly
parasympathetic
physiotherapist
physiotherapy
psychotherapeutic
psychotherapist
psychotherapy
radiotherapy
southeastern
southernmost
theoretician
weatherbeaten
weatherproof
weatherstrip
weatherstripping</pre>


=={{header|VBA}}==
=={{header|VBA}}==