How to increment a value with leading zeroes?

后端 未结 7 1475
一整个雨季
一整个雨季 2021-02-05 22:23

What would be the best way to increment a value that contains leading zeroes? For example, I\'d like to increment \"00000001\". However, it should be noted that the number of

相关标签:
7条回答
  • 2021-02-05 23:09

    Store your number as an integer. When you want to print it, add the leading zeros. This way you can easily do math without conversions, and it simplifies the thought process.

    0 讨论(0)
提交回复
热议问题