Java Random Long randomStr(long strLen)

Here you can find the source of randomStr(long strLen)

Description

random Str

License

Open Source License

Declaration

public static String randomStr(long strLen) 

Method Source Code

//package com.java2s;
//License from project: GNU General Public License 

public class Main {
    public static String randomStr(long strLen) {

        char freshChar;
        String freshString;// w  w  w. j a  v a  2 s .  c  om
        freshString = "";

        while (freshString.length() < (strLen - 1)) {

            freshChar = (char) (Math.random() * 128);
            if (Character.isLetter(freshChar)) {
                freshString += freshChar;
            }
        }

        return (freshString);

    }
}

Related

  1. randomLong()
  2. randomLong(long min, long max)
  3. randomLong(long x, long y)
  4. randomLongWithMinMax(long min, long max)
  5. randomSleep(long ms)
  6. randomStr(long strLen)
  7. randPosLong()
  8. secureRandomLong()