java printf whitespace code example Example: java printf trailing whitespace System.out.printf("%-20s", str);