I want to iterate over the alphabet like so:
foreach(char c in alphabet)
{
//do something with letter
}
Is an array of chars the best way to do this? (feels hacky)
Edit: The metric is "least typing to implement whilst still being readable and robust"
(Assumes ASCII, etc)
Alternatively, you could split it out to a provider and use an iterator (if you're planning on supporting internationalisation):
I found this:
while randomly reading this blog, and thought it was an interesting way to accomplish the task.
You could do this:
Though, not the best way either. Maybe we could help better if we would know the reason for this.
Or you could do,