Generate a random character C# with Example



Generate a random character C# with Example

Generate 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() 

0 Comment's

Comment Form

Submit Comment