From: Ben Bleything Date: 2010-08-11T00:55:03+09:00 Subject: Re: changing the spacing in a string? On Tue, Aug 10, 2010 at 8:51 AM, David Ainley wrote: > Hey guys.  I have an array full of strings.  When I put the strings, it > looks like this http://pastebin.com/eeicUCqL which is okay, but it looks > a little sloppy to me.  Is there a way I can get the strings to > dynamically space themselves so that they look evenly spaced? ala > http://pastebin.com/cRcG97sK ?  Should I split each string into it's > separate parts, and then print them via format?  Or something...? You've got a few options, depending on how sophisticated you want to get. Based on that small sample, it looks like the easiest thing to do might be to replace runs of multiple spaces with a single tab. Something like: str.gsub( /\s+/, "\t" ) Otherwise, you could definitely split it on spaces and print using #printf and a carefully-crafted format string. Ben