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.
So that for example if you had the following numbers:
1 2 3 5 6 7 10 12
It would output
1 - 3, 5 - 7, 10, 12
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.
So that for example if you had the following numbers:
1 2 3 5 6 7 10 12
It would output
1 - 3, 5 - 7, 10, 12