. , , Java . , Android uuid.split("-")
uuid.replace("-")
. , , Java "-" . , uuid.split("\\-")
uuid.replace("\\-")
, . , . , Java.
Fildor, Android uuid.split("-")
uuid 5 . - uuid 5 . "Invalid UUID".
Android, . substring()
, uuid 5 . uuid.
:
public static UUID makeUuid(String uuidString) {
String[] parts = {
uuidString.substring(0, 7),
uuidString.substring(9, 12),
uuidString.substring(14, 17),
uuidString.substring(19, 22),
uuidString.substring(24, 35)
};
long m1 = Long.parseLong(parts[0], 16);
long m2 = Long.parseLong(parts[1], 16);
long m3 = Long.parseLong(parts[2], 16);
long lsb1 = Long.parseLong(parts[3], 16);
long lsb2 = Long.parseLong(parts[4], 16);
long msb = (m1 << 32) | (m2 << 16) | m3;
long lsb = (lsb1 << 48) | lsb2;
return new UUID(msb, lsb);
}