Created
July 5, 2012 09:00
-
-
Save SamWM/3052464 to your computer and use it in GitHub Desktop.
List of age ranges
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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