RandomStringUtils.random : RandomStringUtils « Apache Common « Java Tutorial






import org.apache.commons.lang.RandomStringUtils;

public class MainClass {
    public static void main(String[] args) {
        //Random 8 chars string from within the characters ABCDEF
        System.out.print("1) 8 char string using chars ABCDEF >>>");
        System.out.println(RandomStringUtils.random(8, "ABCDEF"));


    }
}
1) 8 char string using chars ABCDEF >>>FAADCDAF
  Download:  CommonLangRandomStringUtils.random.zip( 199 k)







37.11.RandomStringUtils
37.11.1.RandomStringUtils.randomNumeric
37.11.2.RandomStringUtils.randomAlphanumeric
37.11.3.RandomStringUtils.randomAlphabetic
37.11.4.RandomStringUtils.random3
37.11.5.RandomStringUtils.random2
37.11.6.RandomStringUtils.random