Skip to content

Instantly share code, notes, and snippets.

@SamWM
Created July 5, 2012 09:00
Show Gist options
  • Save SamWM/3052464 to your computer and use it in GitHub Desktop.
Save SamWM/3052464 to your computer and use it in GitHub Desktop.
List of age ranges
class MyClass
{
public static List<string> AgeRanges
{
get
{
int start = 10;
int end = 59;
int step = 5;
int i = start;
List<string> l = new List<string>();
while (i < end)
{
l.Add(string.Format("{0}-{1}", i, (i + step - 1)));
i = i + step;
}
return l;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment