扫码抢去除前面为0

玉溪
LAPTOP-S9HJSOEB\昊天 3 months ago
parent 8b61d0754d
commit ae8065f611

@ -19,6 +19,9 @@ import java.nio.charset.StandardCharsets;
@Slf4j
@Service("scanGunScanService")
public class ScanGunScanServiceImpl implements ScanService{
public static void main(String[] args) {
System.out.println("000856250".replaceAll("^0+", ""));
}
@Resource
private SensorGunService sensorService;
@ -40,6 +43,7 @@ public class ScanGunScanServiceImpl implements ScanService{
log.info("count:{},ip:{},code:{}",i,ip,code);
if(code!= null){
code = code.replace("\\n","");
code = code.replaceAll("^0+", "");
}
i++;
}

Loading…
Cancel
Save