Generate a random character
suggest changeGenerate a random letter between a
and z
by using the Next()
overload for a given range of numbers, then converting the resulting int
to a char
Random rnd = new Random();
char randomChar = (char)rnd.Next('a','z');
//'a' and 'z' are interpreted as ints for parameters for Next()
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents