From: Bill Kelly Date: 2008-01-14T18:43:49+09:00 Subject: Re: setting string width From: "hurcan solter" > > Hi there,Just a quick question ... > I'd like to insert newlines into a string around every 80ish > character and those newlines shouldnt cut the words in the middle. Can > anybody post a snippet how to do that Here's one way to do it: string.gsub(/(.{75,}?\S*)\s+/, "\\1\n") It meets the criteria of "around every 80ish character"... :-) Regards, Bill