From: Robert Klemme Date: 2006-06-26T03:51:34+09:00 Subject: Re: Missing parantheses maybe ? 2006/6/24, Dark Ambient : > .rjust dosn't seem to be working correctly, no error, but it's not > right justifying either. > > my output for the .rjust looks like this: > Chapter 1 Getting Started > page 1 > Chapter 2 Numbers > page 9 > Chapter 3 Letter > page 13 > > here is the first line (Chapter 1...) > > puts( toc[1].ljust(line_width) + toc[2].ljust(line_width) > + toc[3].rjust(line_width)) > > I hand tweaked teh .rjust parameter with hard numbers .rjust(20) > > .rjust(25), etc and that helped but I thought .rjust would > make sure the last letters of the strings would all line up. For this scenario sprintf / printf are probably better suited. Kind regards robert -- Have a look: http://www.flickr.com/photos/fussel-foto/