How can i generate different unique string in different length
{
public static string createRandomString(int Length)string _allowedChars = "abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNOPQRSTUVWXYZ";Random randNum = new Random();int outputLength = (int)(randNum.NextDouble() * Length); //<<<<<<<<< moved out of loop
char[] chars = new char[outputLength]; //<<<<<<<< use outputLength here
// not used int allowedCharCount = _allowedChars.Length;
{
chars[i] = _allowedChars[(
}
}
for (int i = 0; i < outputLength; i++)int)((_allowedChars.Length) * randNum.NextDouble())];return new string(chars);
Hi,
This code generates same string some time and different string some time
this is random generate code function.
how can i change if i want different string in different length always?