Words containing "the" substring: Difference between revisions
Content added Content deleted
No edit summary |
|||
Line 908: | Line 908: | ||
32</pre> |
32</pre> |
||
=={{header|VBA}}== |
|||
<lang vb>Sub Main_Contain() |
|||
Dim ListeWords() As String, Book As String, i As Long, out() As String, count As Integer |
|||
Book = Read_File("C:\Users\" & Environ("Username") & "\Desktop\unixdict.txt") |
|||
ListeWords = Split(Book, vbNewLine) |
|||
For i = LBound(ListeWords) To UBound(ListeWords) |
|||
If Len(ListeWords(i)) > 11 Then |
|||
If InStr(ListeWords(i), "the") > 0 Then |
|||
ReDim Preserve out(count) |
|||
out(count) = ListeWords(i) |
|||
count = count + 1 |
|||
End If |
|||
End If |
|||
Next |
|||
Debug.Print "Found : " & count & " words : " & Join(out, ", ") |
|||
End Sub |
|||
Private Function Read_File(Fic As String) As String |
|||
Dim Nb As Integer |
|||
Nb = FreeFile |
|||
Open Fic For Input As #Nb |
|||
Read_File = Input(LOF(Nb), #Nb) |
|||
Close #Nb |
|||
End Function</lang> |
|||
{{out}} |
|||
<pre>Found : 32 words : 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|Wren}}== |
=={{header|Wren}}== |