Java对字符串32位的uuid添加上横杠
StringBuffer stringBuilder=new StringBuffer("f7504588c65a4b99bc20cf1646f58ef1"); stringBuilder.insert(8,"-"); stringBuilder.insert(12,"-"); stringBuilder.insert(16,"-"); stringBuilder.insert(20,"-"); // 校验是否转换成功 UUID uuid = UUID.fromString(stringBuilder.toString());
本文来自博客园,作者:迷糊桃,转载请注明原文链接:https://www.cnblogs.com/mihutao/p/17101982.html