Created
February 29, 2012 14:10
-
-
Save jsvnm/1941125 to your computer and use it in GitHub Desktop.
get next value in A..Z range using two lambdas, one Func<char> variable
This file contains 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
static public class A_Z_cycle | |
{ | |
static public Func<char> Next = () => { | |
const char a='A', b='Z', c=(char)(b-a+1); | |
int n=-1; | |
return (Next=(()=>(char)(a + (n=(n+1)%c))))(); | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment