Home page

Saturday, July 27, 2019

Generate random string

import org.apache.commons.lang3.RandomStringUtils;

public static String randomString(){
String generated_RandomString = RandomStringUtils.randomAlphabetic(5);
return(generated_RandomString);
}

Note: Save this method as a utility or in the base class and call it when random string is required to create email or anything.

No comments:

Post a Comment