title: Remove extra white space from inside a C string?
body: <p>I have read a few lines of text into an array of C-strings. The lines have an arbitrary number of tab or space-delimited columns, and I am trying to figure out how to remove all the extra whitespace between them. The end goal is to use strtok to break up the columns. This is a good example of the columns:</p>
  
  <pre>
  Cartwright   Wendy    93
  Williamson   Mark     81
  Thompson     Mark     100
  Anderson     John     76
  Turner       Dennis   56</pre>
  
  <p>How can I eliminate all but one of the spaces or tabs between the columns so the output looks like this?</p>
  
  <pre>
  Cartwright Wendy 93</pre>
  
  <p>Alternatively, can I just replace all of the whitespace between the columns with a different character in order to use strtok? Something like this?</p>
  
  <pre>
  Cartwright#Wendy#93
  </pre>
  
  <p><p><strong>edit:</strong> Multiple great answers, but had to pick one. Thanks for the help all.</p>