Since 1.5, String.format() can be used to left/right pad a given string. Letโs see how it can be used to do that.