RandomString Method
Definition
RandomString(int)
Generates a random string with the specified length using values of LettersAndNumbers.
public static string RandomString(int length)
Parameters
lengthintThe 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
lengthintThe length of the random string to generate.
valuesstring[]The values to use in the randomization process.
Returns
- string
A random string from the values provided.
Exceptions
- ArgumentNullException
valuescannot be null.- ArgumentException
valuescontains no elements.