RandomStringUtils generate random numbers

There is a random number tool class RandomStringUtils in the org.apache.commons.lang package, which is a tool class for generating random numbers of a given length according to a specified string array. The accumulator contains many methods, all of which return random number strings. Each method provides at least one parameter int count, which represents the length of the random number to be generated.

//Generate a 5-digit random string, which is garbled in Chinese environment

//Use the specified character to generate a 5-digit random string
RandomStringUtils.random(5, new char[]{'a ','b','c','d','e','f', '1', '2', '3'});

//Generate a random combination string of letters and numbers of the specified length

//Generate a random number string

//Generate a random [az] string, including case

//Generate from ASCII 32 to 126 The random string

Guess you like