how to check if a string "I want to eat apples", contains a string from the list of strings?
Here's the code that I'm trying to use:
Dim CONTAINER As String() = {"eat", "dog", "cat"}
If STRING1.Text.Contains(CONTAINER(0..All?)) Then
Dim ioFileT As New System.IO.StreamReader("C:\strings\RANDOMWORD.txt")
Dim linesT As New List(Of String)
Dim rndT As New Random()
Dim lineT As Integer
Dim RANDOMWORDFROMTXTFILE As String
While ioFileT.Peek <> -1
linesT.Add(ioFileT.ReadLine())
End While
lineT = rndT.Next(linesT.Count + 0)
RANDOMWORDFROMTXTFILE = (lines(line).Trim())
Console.Write(RANDOMWORDFROMTXTFILE)
End If
ioFileT.Dispose()after using it. Or you might be interested in the File.ReadAllLines method, as inDim linesT As String() = IO.File.ReadAllLines("C:\strings\RANDOMWORD.txt").