How do you left pad an int
with zeros when converting to a String
in java?
I'm basically looking to pad out integers up to 9999
with leading zeros (e.g. 1 = 0001
).
转载于:https://stackoverflow.com/questions/473282/how-can-i-pad-an-integer-with-zeros-on-the-left