scala:一行代码生成随机字符串

原理:生成一个随机的BigInt,然后将它转化为36进制。BigInt可以表示任意大的整数。

BigInt(2000, scala.util.Random).toString(36)

猜你喜欢

转载自blog.csdn.net/xuejianbest/article/details/85248284
今日推荐