I have a need to left-pad a
java string with a number of spaces that depends on my data. I looked for things to do this and found the following:
So now I'm trying to figure out what the "#" means. I looked up Formattable in the java javadocs, and found (only) a set of examples. The set includes the "#", but it does NOT tell me what the flag does.
I have found various references to it specifying an "alternate format", defined by the class, and there is an ALTERNATE
test within the example in the Formattable javadocs, but the example to left-pad the string above is not using that class. Does String have a definition for an "alternate format" in relation to Formattable? I can't even find that String implements Formattable, and there's no "#" character in its javadoc.
I know I could "play around with this" and make a reasonable guess, but it frustrates me that I cannot find a definition. Examples are not sufficient instruction, though they help...