title: Searching a string array without built in methods
body: <p>If anyone can help out there, I'll be tremendously grateful.</p>
  
  <p>Essentially I am working on a homework project where, for part of it, I need to search an array. The array, I currently have as a String type, but is essentially a collection of dates. (In the format 05/06/2014)</p>
  
  <p>I am just about at my wits end trying to find a way to allow the user to search this array, in particular that doesn't use built in methods like array.binarysearch etc.</p>
  
  <p>I tried to implement a binary search but that didn't seem to work, I can provide code if you wish to see where I'm probably going wrong. But is there perhaps a better search I should use for this string type, or should I be converting the string array into a different type?</p>
  
  <p>If anyone can help I would greatly appreciated, I'm not necessarily asking for anyone to do my work for me I'd just be thrilled if someone could bump me in the right direction, as this problem has been doing my nut in. Thanks!</p>
  
  <p>Current Binary Search Code:</p>
  
  <pre><code>public static void BinarySearch(string[] dateArray, string searchTerm)
  {
      int first = 0;
      int last = dateArray.Length - 1;
      int position = -1;
      bool found = false;
      int compCount = 0;
  
  
      while (found != true &amp;&amp; first &lt;= last)
      {
          int middle = (first + last) / 2;
  
          int comparisonSTR = string.Compare(dateArray[middle], searchTerm);
  
          if (dateArray[middle] == searchTerm)
          {
              found = true;
              position = middle;
              compCount++;
  
              Console.WriteLine("Your search has been found after " + compCount + "comparisons.");
          }
  
          else if (comparisonSTR &gt; 0)
          {
              last = middle;
              compCount++;
          }
  
          else
          {
              first = middle;
              compCount++;
          }
      }
  }
  </code></pre>