How to refactor this to be one line?
String format = "%-20s";
System.out.print(String.format(format, "Property name"));
System.out.println(": property value");
Likely I want to have something like this, the question is what format should I use?
System.out.println(String.format(format, "Property name", ": property value"));
1 Answer