public final class RandomStringUtils extends Object
RandomUtils| 限定符和类型 | 方法和说明 |
|---|---|
static String |
random(int count)
生成随机字符串
|
static String |
random(int count,
boolean letters,
boolean numbers)
生成随机字符串
|
static String |
random(int count,
char... chars)
生成随机字符串
|
static String |
random(int count,
int start,
int end,
boolean letters,
boolean numbers)
生成随机字符串
|
static String |
random(int count,
String chars)
生成随机字符串
|
static String |
randomAlphabetic(int count)
生成随机字符串 (只包含字母)
|
static String |
randomAlphabetic(int minLengthInclusive,
int maxLengthExclusive)
生成随机字符串 (只包含字母)
|
static String |
randomAlphanumeric(int count)
生成随机字符串 (只包含字母和数字)
|
static String |
randomAlphanumeric(int minLengthInclusive,
int maxLengthExclusive)
生成随机字符串 (只包含字母和数字)
|
static String |
randomAscii(int count)
生成随机字符串 (只包含ascii)
|
static String |
randomAscii(int minLengthInclusive,
int maxLengthExclusive)
生成随机字符串 (只包含ascii)
|
static String |
randomGraph(int count)
生成随机字符串 (只包含图形支付)
|
static String |
randomGraph(int minLengthInclusive,
int maxLengthExclusive)
生成随机字符串 (只包含图形支付)
|
static String |
randomNumeric(int count)
生成随机字符串 (只包含数字)
|
static String |
randomNumeric(int minLengthInclusive,
int maxLengthExclusive)
生成随机字符串 (只包含数字)
|
static String |
randomPrint(int count)
生成随机字符串 (只包含可显示字符)
|
static String |
randomPrint(int minLengthInclusive,
int maxLengthExclusive)
生成随机字符串 (只包含可显示字符)
|
static String |
randomUUID()
生成随机UUID字符串
|
static String |
randomUUID(boolean removeHyphen)
生成随机UUID字符串
|
public static String random(int count)
count - 字符串长度public static String randomAscii(int count)
count - 字符串长度public static String randomAscii(int minLengthInclusive, int maxLengthExclusive)
minLengthInclusive - 可能的长度最小值 (包含)maxLengthExclusive - 可能的长度最大值 (不包含)public static String randomAlphabetic(int count)
count - 字符串长度public static String randomAlphabetic(int minLengthInclusive, int maxLengthExclusive)
minLengthInclusive - 可能的长度最小值 (包含)maxLengthExclusive - 可能的长度最大值 (不包含)public static String randomAlphanumeric(int count)
count - 字符串长度public static String randomAlphanumeric(int minLengthInclusive, int maxLengthExclusive)
minLengthInclusive - 可能的长度最小值 (包含)maxLengthExclusive - 可能的长度最大值 (不包含)public static String randomGraph(int count)
count - 字符串长度public static String randomGraph(int minLengthInclusive, int maxLengthExclusive)
minLengthInclusive - 可能的长度最小值 (包含)maxLengthExclusive - 可能的长度最大值 (不包含)public static String randomNumeric(int count)
count - 字符串长度public static String randomNumeric(int minLengthInclusive, int maxLengthExclusive)
minLengthInclusive - 可能的长度最小值 (包含)maxLengthExclusive - 可能的长度最大值 (不包含)public static String randomPrint(int count)
count - 字符串长度public static String randomPrint(int minLengthInclusive, int maxLengthExclusive)
minLengthInclusive - 可能的长度最小值 (包含)maxLengthExclusive - 可能的长度最大值 (不包含)public static String random(int count, boolean letters, boolean numbers)
count - 字符串长度letters - 是否可包含字母numbers - 是否可包含数字public static String random(int count, int start, int end, boolean letters, boolean numbers)
count - 字符串长度start - 开始字符end - 结束字符letters - 是否可包含字母numbers - 是否可包含数字public static String random(int count, String chars)
count - 随机字符串长度chars - 随机字符串的可能的字符从此参数中获得public static String random(int count, char... chars)
count - 随机字符串长度chars - 随机字符串的可能的字符从此参数中获得public static String randomUUID()
public static String randomUUID(boolean removeHyphen)
removeHyphen - 结果中是否要移除字符"-"Copyright © 2022. All rights reserved.