The title says it all. I want to generate the alphabet as a vector of characters. I did consider simply creating a range of 97-122 and converting it to characters, but I was hoping there would be a nicer looking way, such as Python's string.ascii_lower
.
The resulting vector or string should have the characters a-z.
Collecting the characters of a
str
doesn't seem like a bad idea...Hard-coding this sort of thing makes sense, as it can then be a compiled constant, which is great for efficiency.
(Decide for yourself whether to use
static
orconst
.)This is pretty much how Python does it in string.py: