在JavaScript中,将此字符串转换为最简单的方法是什么?
798205486e954fa880a0b366e6725f71
转换为像这样的GUID格式
79820548-6e95-4fa8-80a0-b366e6725f71
这是我目前的笨方法🙈,我正在寻找更简洁的方式💡
var employeeId = shift.employee.id.substring(0, 8) + "-" + shift.employee.id.substring(8, 12)
+ "-" + shift.employee.id.substring(12, 16) + "-" + shift.employee.id.substring(16, 20) + "-" + shift.employee.id.substring(20, 32);