_EagleOwle_

RandomString

Feb 18th, 2020
101
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.     }
RAW Paste Data