Generate a random character

suggest change

Generate a random letter from a through z. Next takes int bounds, and a char converts to its UTF-16 code unit. The upper bound is exclusive, so pass 'z' + 1 to include z.

Random rnd = new Random();
char randomChar = (char)rnd.Next('a', 'z' + 1);

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents