I have a problem with printf in java. I would like to define the spaces with a variable.
String a = "bar";
String b ="foo";
System.out.printf("%-10s %s", b, a);
//Output:foo*7spaces*bar
The "10" should be changeable. I hope you know what I mean. Thank you guys!