Java 代码将 MAC 地址 8089174498B4 格式化为 80:89:17:44:98:B4
String macAddress = '8089174498B4';
String formattedMacAddress = macAddress.replaceAll('(?<=\G..)(?!$)', ':');
System.out.println(formattedMacAddress);
输出结果为:80:89:17:44:98:B4
原文地址: https://www.cveoy.top/t/topic/oaAL 著作权归作者所有。请勿转载和采集!