title: Shortening list of numbers with hyphens between consecutive numbers
body: <p>Is there a simple way to take a list of numbers which can be in the range 1 - 15. And put a dash in place of consecutive numbers. </p>
  
  <p>So that for example if you had the following numbers: </p>
  
  <p><code>1 2 3 5 6 7 10 12</code></p>
  
  <p>It would output</p>
  
  <p><code>1 - 3, 5 - 7, 10, 12</code></p>