Line formatting with Ruby.

Posted by dbtek on Stack Overflow See other posts from Stack Overflow or by dbtek
Published on 2010-05-20T14:43:41Z Indexed on 2010/05/20 14:50 UTC
Read the original article Hit count: 145

Filed under:
|
|
|
|

There is a text file containing words with 1 space between each of them. And there is also a command line entry that gives the length of line (output) wanted. Output will be words that fit into the length of the line (taken from command line).

Also the first word will be on the left side of the line and the last word will be right side of it. The spaces between each word will be same.

Any help will be appreciated thanks for replying.

© Stack Overflow or respective owner

Related posts about ruby

Related posts about text