text alignment using String.format
in
Programming Questions
•
1 year ago
hi, i would like to align my code neatly, for example:
abc :
abcdefg :
awsgg :
as you can see i want to align the semi-colon all in line, here's my code below, but it seems not able align the way i wanted.
size(300,300);textSize(20);text(String.format("%-20s %-2s","Hello World", ":"),10,40);text(String.format("%-20s %-2s","Hi", ":"),10,70);text(String.format("%-20s %-2s","Hello", ":"),10,100);
1