java去掉前导零

2024-02-15 17:12:04

```java

String number = "";

int result = Integer.parseInt(number);

```

这段代码会将带有前导零的字符串转换为整数,自动去除前导零。