Table of Contents

RandomString Method

Definition

Namespace
Cuemon
Assemblies
Cuemon.Core.dll
Source
src/Cuemon.Core/Generate.cs

RandomString(int)

Generates a random string with the specified length using values of LettersAndNumbers.

public static string RandomString(int length)

Parameters

length int

The length of the random string to generate.

Returns

string

A random string from the values of LettersAndNumbers.

RandomString(int, params string[])

Generates a random string with the specified length from the provided values.

public static string RandomString(int length, params string[] values)

Parameters

length int

The length of the random string to generate.

values string[]

The values to use in the randomization process.

Returns

string

A random string from the values provided.

Exceptions

ArgumentNullException

values cannot be null.

ArgumentException

values contains no elements.