Skip to content
Snippets Groups Projects

seq to ranges and ranges to seq

  • Clone with SSH
  • Clone with HTTPS
  • Embed
  • Share
    The snippet can be accessed without any authentication.
    Authored by Auke Klazema

    My version of the problem given to us by Sander ter Veen on our Slack.

    How to convert sequence of numbers to ranges. Ex. "1,2,5,6,7,8,11" -> "1-2,5-8,11". And the other way around.

    Edited
    snippetfile1.txt 2.69 KiB
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Please register or to comment