生成的UUID带有 “-”,使用起来并不方便,通过replace(“-”,“”)方法去掉。
生成代码如下:
String uuid = UUID.randomUUID().toString().replaceAll("-", "");
另付在线生成uuid的网址:http://www.uuid.online/
生成的UUID带有 “-”,使用起来并不方便,通过replace(“-”,“”)方法去掉。
生成代码如下:
String uuid = UUID.randomUUID().toString().replaceAll("-", "");
另付在线生成uuid的网址:http://www.uuid.online/