C# Language Generating Random Numbers in C# Generate a random character

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

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


Got any C# Language Question?