Words containing "the" substring: Difference between revisions

Content added Content deleted
(Added Delphi example)
Line 581: Line 581:
end if
end if
end for</lang>
end for</lang>

=={{header|Objeck}}==
<lang objeck>
class Thes {
function : Main(args : String[]) ~ Nil {
if(args->Size() = 1) {
reader := System.IO.File.FileReader->New(args[0]);
words := Collection.Generic.Vector->New()<String>;
line := reader->ReadLine();
while(line <> Nil) {
if(line->Size() > 11 & line->Has("the")) {
words->AddBack(line);
};
line := reader->ReadLine();
};
reader->Close();

found := words->Size();
"Found {$found} word(s):"->PrintLine();
each(i : words) {
word := words->Get(i);
"{$word} "->Print();
if(i > 0 & i % 5 = 0) {
'\n'->Print();
};
};
};
}
}</lang>

{{out}}
<pre>
Found 32 word(s):
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|Perl}}==
=={{header|Perl}}==
Line 619: Line 659:
weatherstripping
weatherstripping
/Code$ </lang>
/Code$ </lang>



=={{header|Phix}}==
=={{header|Phix}}==