Java Random String getRandomStr()

Here you can find the source of getRandomStr()

Description

get Random Str

License

Apache License

Declaration

public static String getRandomStr() 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    private static final String RANDOM_STR = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
    private static final java.util.Random RANDOM = new java.util.Random();

    public static String getRandomStr() {
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < 16; i++) {
            sb.append(RANDOM_STR.charAt(RANDOM.nextInt(RANDOM_STR.length())));
        }//from w ww  .  ja v  a  2s.com
        return sb.toString();
    }
}

Related

  1. getRandomFromTier(int tier, String lvlRange)
  2. getRandomNumberString(int length)
  3. getRandomNumberString(int maxValue, int strLen)
  4. getRandomNumberStringBase36(int strLen)
  5. getRandomStr()
  6. getrandomstr()
  7. getRandomStr()
  8. getRandomStr()
  9. getRandomStr(int Len)