I have a string that will later be converted with int()
. It is three digits, anywhere from 0 to 3 of them might be 0's. How would I strip the 0s from the left side of the string?
Now I'm using string.lstrip('0')
but that strips all the 0s and makes the string empty, causing an error.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…