RandomStringUtils: random(int count, boolean letters, boolean numbers)
/*
2) 8 char string using letters but no numbers >>>PpdhkEBn
*/
import org.apache.commons.lang.RandomStringUtils;
public class RandomStringUtilsTrial {
public static void main(String[] args) {
//Random 8 chars string where letters are enabled while numbers are not.
System.out.print("2) 8 char string using letters but no numbers >>>");
System.out.println(RandomStringUtils.random(8, true, false));
}
}
Apache-Common-Lang.zip( 248 k)Related examples in the same category