title: C# Read Text File Containing Data Delimited By Tabs
body: <p>I have some code:</p>
  
  <pre><code> public static void ReadTextFile()
      {
          string line;
  
          // Read the file and display it line by line.
          using (StreamReader file = new StreamReader(@"C:\Documents and Settings\Administrator\Desktop\snpprivatesellerlist.txt"))
          {
              while ((line = file.ReadLine()) != null)
              {
  
                  char[] delimiters = new char[] { '\t' };
                  string[] parts = line.Split(delimiters, StringSplitOptions.RemoveEmptyEntries);
                  for (int i = 0; i &lt; parts.Length; i++)
                  {
  
                       Console.WriteLine(parts[i]);
                       sepList.Add(parts[i]);
  
                  }
  
              }
  
              file.Close();
          }
          // Suspend the screen.
          Console.ReadLine();     
      }
  </code></pre>
  
  <p>It reads in a text file that contains data delimited by tabs and splits the data into separate words.</p>
  
  <p>The problem I have is that once the data has been separated, it still has massive amounts of white space on the left and right sides on random strings in the list (Infact most of them do). I can't trim the string because it only removes white space, and technically this isn't white space.</p>
  
  <p>Anyone got any ideas on how to get round this problem!?</p>