S
shapper
Hello,
I created the following String extension to use the characters on a
String and create a new random string with those characters and with a
given length:
public static String Random(this String value, Int32 length) {
StringBuilder randomized = new StringBuilder(length);
while (length-- > 0)
randomized.Append(value[random.Next(value.Length)]);
return randomized.ToString();
} // Random
If a length is not provided it is used the value length.
How can I use All characters if a value is not provided, eg, value is
String.Empty.
My problem is to get a list of all characters.
Thanks,
Miguel
I created the following String extension to use the characters on a
String and create a new random string with those characters and with a
given length:
public static String Random(this String value, Int32 length) {
StringBuilder randomized = new StringBuilder(length);
while (length-- > 0)
randomized.Append(value[random.Next(value.Length)]);
return randomized.ToString();
} // Random
If a length is not provided it is used the value length.
How can I use All characters if a value is not provided, eg, value is
String.Empty.
My problem is to get a list of all characters.
Thanks,
Miguel