How to increment a value with leading zeroes?

后端 未结 7 1461
一整个雨季
一整个雨季 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 22:49

    Determine the length, convert it to an integer, increment it, then convert it back to a string with leading zeros so that it has the same length as before.

提交回复
热议问题