Hi,
If the requirement is just a random generated unique string, probably you might think of using the below.
public static string createRandomString(int Length)
{
char[] charsToIgnore = {'0', '1','2', '3', '4', '5', '6', '7', '8', '9', '-'};
string uniqueString = Guid.NewGuid().ToString();
for(int i=0; i<charsToIgnore.Length; i++)
{
uniqueString = uniqueString.Replace(charsToIgnore[i].ToString(), "");
}
return uniqueString.Substring(0, Length);
}
The Guid class always generates unique but in hex dec. But, you may trim the unwanted chars as done above.
Cheers
- Balaji