All checks were successful
Deploy to Dokku / docker (ubuntu-latest) (push) Successful in 1m10s
21 lines
523 B
Java
21 lines
523 B
Java
package cc.fascinated.bat.common;
|
|
|
|
/**
|
|
* @author Fascinated (fascinated7)
|
|
*/
|
|
public class StringUtils {
|
|
/**
|
|
* Generates a random string
|
|
*
|
|
* @param length the length of the string
|
|
* @return the random string
|
|
*/
|
|
public static String randomString(int length) {
|
|
StringBuilder stringBuilder = new StringBuilder();
|
|
for (int i = 0; i < length; i++) {
|
|
stringBuilder.append((char) (Math.random() * 26 + 'a'));
|
|
}
|
|
return stringBuilder.toString();
|
|
}
|
|
}
|