Skip to content

Instantly share code, notes, and snippets.

@kmorcinek
Created June 2, 2015 07:08
Show Gist options
  • Save kmorcinek/80f2f831d36b01606253 to your computer and use it in GitHub Desktop.
Save kmorcinek/80f2f831d36b01606253 to your computer and use it in GitHub Desktop.
private IEnumerable<string> GetAlphabetVariations()
{
char[] alphabet = "abcdefghijklmnopqrstuvwxyz".ToCharArray();
foreach (var first in alphabet)
{
foreach (var second in alphabet)
{
yield return "" + first + second;
}
}
// Use recursion for longer strings.
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment