import java.util.UUID;
public class TestMain {
public static void main(String[] args) {
String str = UUID.randomUUID().toString();
System.out.println(str);
System.out.println(str.length());
str = str.replace("-", "");
System.out.println(str);
System.out.println(str.length());
}
}
执行结果:
1e9704ad-61fc-424a-a32c-ae3f96c48e4a 36 1e9704ad61fc424aa32cae3f96c48e4a 32



