You can use string.format method to specify left or right padding.