I'm converting an integer to a string, but always need it to be exactly four characters long, zero filling from the left. For example:
Integer n = 25;
String out = "00" + 25 ; // "0025"
My integers will always be less than 5 characters long, I just need them to always be zero filled when less than 4 characters long. What can I do to accomplish it?