Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static string GenerateRandomString(int count = 10000,bool endnl = false) {
- Random rand = new Random(Guid.NewGuid().ToString().GetHashCode());
- return GenerateRandomString(rand,count,endnl);
- }
- static string GenerateRandomString(Random rand,int count = 10000,bool endnl = false) {
- StringBuilder sb = new StringBuilder(count);
- for(int i = 0;i < count;i++)
- sb.Append((char)('a' + rand.Next(0,26)));
- if(endnl)
- sb.AppendLine();
- return sb.ToString();
- }
Advertisement
Add Comment
Please, Sign In to add comment