private string FormatNum(string arg, params int[] num)
{
if (num.Length == 0)
{
throw new ArgumentException("You must specify at least one number to format.");
}
int length = int.Parse(arg);
// Build the format string for the specfied number of digits.
string zeros = "{0:";
if (length == 0)
{
zeros += "0";
}
else
{
for (int i = 0; i < length; i++)
{
zeros += "0";
}
}
zeros += "}";
return num.Distinct().Select(x => string.Format(zeros, x)).Aggregate((x, y) => x + "-" + y);
}