title: How can I get specific items from text file? Visual Basic 2010
body: <p>I am trying to figure out how to get a message box to show only specific words from a text file, which contains all of the words within the dictionary. I have tried various different ways, but cannot get it to work, but I do think I am on the right track so just need some pointers.</p>
  
  <p>Basically, there is a scrambled up string, which is different every time, and is contained within a label. I want the program to only show words which contains the letters inside the scrambled string, but not sure how to achieve this?</p>
  
  <p>Here is the code that I have so far:</p>
  
  <pre><code>Private Sub btnAnswers_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAnswers.Click
  
      Dim hash As List(Of String) = New List(Of String)(System.IO.File.ReadAllLines("C:\Users\Katie\Documents\Project\dictionary.txt"))
      Dim Letters As String
      Dim OneCharacter As String
      Dim Found As Boolean
      Dim item As String
      Dim AllCharacters As String
  
      Found = False
      Letters = lblLetters.Text
  
      For i = 0 To Letters.Length - 1
          OneCharacter = Letters.Substring(i, 1)
          For Each item In hash
              If item.Contains(OneCharacter) Then
                  Found = True
                  AllCharacters = OneCharacter
              Else
                  Found = False
              End If
              MsgBox(item)
          Next
      Next i
  End Sub
  </code></pre>
  
  <p>The message box does show up words, from the dictionary, but words can contain letters that are not present in the label string, so my code is wrong. Can anyone help? Apologies, but I am new to programming.</p>