RandomNameGeneratorNG 2.0.1
See the version list below for details.
dotnet add package RandomNameGeneratorNG --version 2.0.1
NuGet\Install-Package RandomNameGeneratorNG -Version 2.0.1
<PackageReference Include="RandomNameGeneratorNG" Version="2.0.1" />
paket add RandomNameGeneratorNG --version 2.0.1
#r "nuget: RandomNameGeneratorNG, 2.0.1"
// Install RandomNameGeneratorNG as a Cake Addin #addin nuget:?package=RandomNameGeneratorNG&version=2.0.1 // Install RandomNameGeneratorNG as a Cake Tool #tool nuget:?package=RandomNameGeneratorNG&version=2.0.1
DotNetRandomNameGenerator
Generates random people and place names drawn from freely available US census data.
The library contains a stripped down lists of human names from the US Census names list, and a list of place names from another census list. The library allows you to get random first and last names or both and you can get male and female first names. You can also generate random place names as well. To access this functionality create a NameGenerator in namespace RandomNameGenerator, and call one of the functions like GenerateRandomFirstAndLastName(). The functions names describe literally and simply what those functions do.
Typical Usage (generating a person name):
var personGenerator = new PersonNameGenerator();
var name = _personGenerator.GenerateRandomFirstAndLastName();
Console.WriteLine(name); //Outputs some random first and last name combination in the format "{first} {last}" example: "Mark Rogers"
Generating a place name:
var placeGenerator = new PlaceNameGenerator();
var name = _personGenerator.GenerateRandomPlaceName();
Console.WriteLine(name); //Outputs some random place name, example: "Hoboken"
Male and female first names can be generated with or without a last name
var personGenerator = new PersonNameGenerator();
var name = _personGenerator.GenerateRandomFemaleFirstName();
Console.WriteLine(name); //Outputs some random first female name, example: "Jane"
More than one name can be generated at a time. There are a variety of functions that let you choose gender if desired, and the number of names to be produced.
var personGenerator = new PersonNameGenerator();
var numberOfNames = 1;
var names = _personGenerator.GenerateRandomFemaleFirstAndLastName(numberOfNames);
var name = names.First();
Console.WriteLine(name); //Outputs some random first and last female name combination in the format "{first} {last}" example: "Rose Jones"
An existing random object can be passed in, rather than generated by the name generator.
var randomObj = new Random(42);
var personGenerator = new PersonNameGenerator(randomObj);
var name = personGenerator.GenerateRandomFemaleFirstName();
Console.WriteLine(name); //Outputs some random first female name using the passed Random obj, example: "Lindsay"
This functionality can also be exercised has an extension method to a random object.
var randomObj = new Random(42);
var name = randomObj.GenerateRandomFemaleFirstName();
Console.WriteLine(name); //Outputs some random first female name using the passed Random obj, example: "Lindsay"
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 is compatible. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp3.0 was computed. netcoreapp3.1 is compatible. |
.NET Standard | netstandard2.1 is compatible. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETCoreApp 3.1
- No dependencies.
-
.NETStandard 2.1
- No dependencies.
-
net5.0
- No dependencies.
-
net6.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.