Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Simple example of RandomStringUtils
public class RandomStringUtilsExample {
public static void main(String[] args) {
// returns a String with 5 numbers
// example 82114
RandomStringUtils.randomNumeric(5);
// returns an alphanumeric String with length as 30 mixing upper and lower cases
// example gQ6RB8MiwKOg9O3qnHFo7I3jilHoIy
RandomStringUtils.randomAlphanumeric(30);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment