title: Case sensitive search from text file fix?
body: <p>A few days ago, I asked <a href="https://stackoverflow.com/questions/59595553/search-text-file-and-put-matching-results-in-listbox">a question</a> on Stack Overflow, asking how to search a text file for matching strings from a search text box. This has worked great so far, except from the fact that the search was case sensitive. I thought of a way of overcoming this, however it wouldn't work in the way I necessarily wanted it to.</p>
  
  <p>My idea/solution:</p>
  
  <pre class="lang-vb prettyprint-override"><code>If ListBox.Items.Count = 0 Then
      tbx_FindText.CharacterCasing = CharacterCasing.Upper
  ElseIf ListBox.Items.Count = 0 Then
      tbx_FindText.CharacterCasing = CharacterCasing.Lower
  End If
  </code></pre>
  
  <p>This would essentially try both fully upper and lower case, but what happens if the user types a search request such as 'Gsk', well the 'G' is capitalized, but the other characters aren't (because the string is mixed case, not fully upper or lower case), and if it is not the exact same as the string in the text file (whether it be fully upper or lower case or mixed case, then the program reports that there are no search results, when there are - it's just that the search algorithm used is case sensitive and doesn't recognize/search it properly.</p>
  
  <p>Search Algorithm Code:</p>
  
  <pre class="lang-vb prettyprint-override"><code>Dim lines1() As String = IO.File.ReadAllLines("C:\ProgramData\WPSECHELPER\.data\Outlook Folder Wizard\outlookfolders.txt")
  lbx_OFL_Results.Items.Clear()
  lbx_OFL_Results.BeginUpdate()
  For i As Integer = 0 To lines1.Length - 1
      If lines1(i).Contains(tbx_FindText.Text) Then lbx_OFL_Results.Items.Add(lines1(i))
  Next
  lbx_OFL_Results.EndUpdate()
  </code></pre>
  
  <p>Essentially, the code opens the text file, which contains several Outlook Folder Paths needed by employees to do their jobs. They enter a search for a company name or reference number into a search box, and the list box populates with matching results of paths that contain the keywords that were entered in the search text box.</p>
  
  <p>That part works great - apart from the fact the list box doesn't populate with results if my search is capitalized, and the string in the text file isn't, for example.</p>
  
  <p>If anyone could help compose (or reconstruct) a piece of code that searches the text file (trying to keep the code above if possible) whilst the search not being case sensitive, it would be greatly appreciated.</p>