Using ljust to pad out strings
Posted: Sun Apr 23, 2017 6:05 pm
I have been using the ljust command to pad out a string but I actually need to pad the string out with commas (,).
So far I have only been able to do it by assigning the comma to another string and then using that other string in the ljust command like this:
This is because the format of the ljust command needs a comma to separate the 2 essential variables
Could someone please advise me if there is a better way.
So far I have only been able to do it by assigning the comma to another string and then using that other string in the ljust command like this:
Code: Select all
d =','
ljust( myvariable, d)Could someone please advise me if there is a better way.