DEV Community

Cover image for question....how can generate random string in C# ??
Mahmoud-Al-Moukhtar
Mahmoud-Al-Moukhtar

Posted on

question....how can generate random string in C# ??

please
how can generate random sting contain chars and numbers between (10, 999) like this

Top comments (1)

Collapse
 
kaylumah profile image
Max Hamulyák

Not sure If I understand the question correctly.

You can do Guid.NewGuid().ToString() where the .ToString has formatter overloads to remove the hypen.

Otherwise take a look at
github.com/bolorundurowb/shortid/b...

With ShortId you can pass allowed symbols, and length.