Advertisement
_EagleOwle_

RandomString

Feb 18th, 2020
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.52 KB | None | 0 0
  1. public static string RandomString(int stringLength = 6)
  2.     {
  3.         int _stringLength = stringLength - 1;
  4.         string randomString = "";
  5.         string[] characters = new string[] { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z" };
  6.         for (int i = 0; i <= _stringLength; i++)
  7.         {
  8.             randomString = randomString + characters[UnityEngine.Random.Range(0, characters.Length)];
  9.         }
  10.         return randomString;
  11.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement