Re: capitalize only when 4 or more letters are caps
by Dana Merrick other posts by this author
Jul 1 2008 12:58PM messages near this date
capitalize only when 4 or more letters are caps
|
Using hpricot to get tables
It's not really a complete solution, but you can work off of this:
string = "A BB CCC DDDD EEEE FFFFF"
result = string.split.inject([]) do |a,x|
x.downcase! if x[/[A-Z]{4,}/]
a << x
end
p result.join(" ") #=> "A BB CCC dddd eeee fffff"
--
Dana Merrick - System Administrator
Integrated Computer Solutions, Inc.
54B Middlesex Tpke, Bedford, MA 01730
617.621.0060 x112 - http://www.ics.com
Thread:
Chris G.
Dana Merrick
|