我生成了一个可变大小长度的随机字符串,其中包括小写、大写、数字和标点符号。
我正在编写一个 API,它接受任何这些字符的输入(*, ', ?, :, /,\)
并生成带有或不带有给定字符的随机字符串
例子:
randomStringWithSpecialChar(boolean specChar, String... specialChars){
String randomString = "GHHG#^%^57687987*'?:/\fgdg"
if(!specChar){
# I should replace (*, ', ?, :, /,\) with x, so that I can pass it as my testdata
String finalString = "GHHG#^%^57687987xxxxxxfgdg"
}
return finalString
}