forked from MinecraftUtilities/Backend
initial commit
This commit is contained in:
19
src/main/java/cc/fascinated/util/UUIDUtils.java
Normal file
19
src/main/java/cc/fascinated/util/UUIDUtils.java
Normal file
@ -0,0 +1,19 @@
|
||||
package cc.fascinated.util;
|
||||
|
||||
public class UUIDUtils {
|
||||
|
||||
/**
|
||||
* Add dashes to a UUID.
|
||||
*
|
||||
* @param idNoDashes the UUID without dashes
|
||||
* @return the UUID with dashes
|
||||
*/
|
||||
public static String addUUIDDashes(String idNoDashes) {
|
||||
StringBuilder idBuff = new StringBuilder(idNoDashes);
|
||||
idBuff.insert(20, '-');
|
||||
idBuff.insert(16, '-');
|
||||
idBuff.insert(12, '-');
|
||||
idBuff.insert(8, '-');
|
||||
return idBuff.toString();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user