title: How do I strip whitespace from a string in OCaml?
body: <p>To learn the basics of OCaml, I'm solving one of the easy <a href="http://www.facebook.com/careers/puzzles.php?puzzle_id=7" rel="noreferrer">facebook engineering puzzles</a> using it.  Essentially, I'd like to do something like the following Python code:</p>
  
  <pre><code>some_str = some_str.strip()
  </code></pre>
  
  <p>That is, I'd like to strip all of the whitespace from the beginning and the end.  I don't see anything obvious to do this in the OCaml <a href="http://caml.inria.fr/pub/docs/manual-ocaml/libref/Str.html" rel="noreferrer">Str</a> library.  Is there any easy way to do this, or am I going to have to write some code to do it (which I wouldn't mind, but would prefer not to :) ).</p>
  
  <p>Bear in mind that I'm limited to what's in the libraries that come with the OCaml distribution.</p>