2
Answers

How to make this out put using Javascript/C#?

How to make this output using javascript/C#?
 
Sample input below :
 
1,2,3,5,6,8,10,11,13,12
 
Output will be
 
1-3,5-6,8,10,13
 
Thanks in advance. 
Answers (2)