Remove leading zeros in batch file

后端 未结 4 1635
逝去的感伤
逝去的感伤 2020-12-05 23:57

In my application, I get a number having leading zeros. I am trying to trim the leading zeros and get the actual number. I tried using /a switch which considers

4条回答
  •  生来不讨喜
    2020-12-06 00:31

    I found this problem when trying to solve a similar issue myself. I liked your solution until I realized there is a slightly better way:

    SET /a N=1%N%+1%N%-2%N%
    

提交回复
热议问题