From: "Brian Schröder" Date: 2004-10-11T23:23:39+09:00 Subject: Re: string replacement J.Lang wrote: > we need to replace a whitespace with a
if the string is longer > then 30 chars (next whitespace after 30 chars) > > does someone have a idea to programm this in ruby? > > > cheers > mike and john > string = "abcd " * 30 string.gsub /(.{30}\S)\s/, '\1
' regards, Brian -- Brian Schr�der http://ruby.brian-schroeder.de/