title: Mimic Python's strip() function in C
body: <p>I started on a little toy project in C lately and have been scratching my head over the best way to mimic the strip() functionality that is part of the python string objects. </p>
  
  <p>Reading around for fscanf or sscanf says that the string is processed upto the first whitespace that is encountered.</p>
  
  <p>fgets doesn't help either as I still have newlines sticking around.
  I did try a strchr() to search for a whitespace and setting the returned pointer to '\0' explicitly but that doesn't seem to work.</p>