String format dynamic padding
807599Mar 28 2007 — edited Mar 28 2007String.format("%08d", myInt) will return a string 0 padded to a width of 8. But is there a way to have the amount of padding determined from a variable instead of having ot hardcode 8 in there? So if my program determines the padding needs to be X it can just use X in the String.format() method somehow?
I didn't see it in the API, but I may have overlooked it. I'm using Java 1.5
Thanks