Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

generate random name c#

  private void RandName()
  {
        string[] maleNames = new string[1000] { "aaron", "abdul", "abe", "abel", "abraham", "adam", "adan", "adolfo", "adolph", "adrian"};
        string[] femaleNames = new string[1000] { "abby", "abigail", "adele", "adrian"};
        string[] lastNames = new string[1000] { "abbott", "acosta", "adams", "adkins", "aguilar"};

        Random rand = new Random(DateTime.Now.Second);
        if (rand.Next(1, 2) == 1)
        {
            FirstName = maleNames[rand.Next(0, maleNames.Length - 1)];
        }
        else
        {
            FirstName = femaleNames[rand.Next(0, femaleNames.Length - 1)];
        }

  }
Comment

PREVIOUS NEXT
Code Example
Csharp :: update models with ef core 
Csharp :: decimal to string c# 
Csharp :: initialize ConsoleLoggerProvider in EF core 
Csharp :: .net core enum select list 
Csharp :: casting string to enum type 
Csharp :: c# hello world 
Csharp :: c# parse the date in DD/MMM/YYYY format 
Csharp :: how to display an image url in c# picturebox 
Csharp :: how to run code without a gameobject unity 
Csharp :: Unity c#loading a scene after a few seconds 
Csharp :: all month in array 
Csharp :: placeholder syntax c# 
Csharp :: unity on inspector change 
Csharp :: loop through string array c# 
Csharp :: c# dictionary initializer 
Csharp :: how to split concat string c# 
Csharp :: accessing form controls from another class c# 
Csharp :: how to check a list is null or empty in c# 
Csharp :: convert string into double in c# 
Csharp :: look rotation only on y axis in unity 
Csharp :: c# console save file 
Csharp :: how to set unique constraint from EF core 
Csharp :: google sheet script change text color 
Csharp :: replace index in string c# 
Csharp :: c# console header 
Csharp :: capitalize first letter c# 
Csharp :: char contains c# 
Csharp :: Minimize window to system tray c# 
Csharp :: Net.ServicePointManager.SecurityProtocol .net framework 4 
Csharp :: how to add a gameobject 
ADD CONTENT
Topic
Content
Source link
Name
9+2 =