Home > Net >  Java - How to replace spaces of formatting with decimals in printf?
Java - How to replace spaces of formatting with decimals in printf?

Time:04-26

I would like to print out a list of items with a row of periods, or ellipsis, between the first text and final variable with a space on each side. So if the spacing is three or more, there should be a period(s) taking place of the spaces in between. I would like to do this inside of a printf, if possible; using Formatting. I know if I put a 0 in front of the width as a flag, then the extra characters will be taken up as zeros, but I'd like the zeros to be as decimal points instead.

Is it possible to do it this way?

Sample Code:

    System.out.printf("Egg Count:            
  • Related