title: Trying to replace all white space with a single space
body: <p>My program is a file validation utility. I have to read in a format file and then parse out each line by a single space. But obviously, the person who wrote the format file may use tabs, or two spaces, or any form of whitespace, and I'm looking for some code to do that. I've tried this:</p>
  <pre><code>public static string RemoveWhitespace(this string line)
  {
      try
      {
          return new Regex(@&quot;\s*&quot;).Replace(line, &quot; &quot;);
      }
      catch (Exception)
      {
          return line;
      }
  }
  </code></pre>
  <p>I'm assuming this is wrong. What should I do?</p>